linkedapi 1.3.3__tar.gz → 1.3.5__tar.gz

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.
Files changed (106) hide show
  1. {linkedapi-1.3.3 → linkedapi-1.3.5}/PKG-INFO +1 -1
  2. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/__init__.py +7 -1
  3. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/client.py +9 -0
  4. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/errors.py +4 -0
  5. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/__init__.py +6 -0
  6. linkedapi-1.3.5/linkedapi/operations/comment_on_post.py +15 -0
  7. linkedapi-1.3.5/linkedapi/operations/react_to_comment.py +12 -0
  8. linkedapi-1.3.5/linkedapi/operations/reply_to_comment.py +15 -0
  9. linkedapi-1.3.5/linkedapi/operations/retrieve_feed.py +15 -0
  10. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/types/__init__.py +13 -0
  11. linkedapi-1.3.5/linkedapi/types/feed.py +14 -0
  12. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/types/post.py +23 -0
  13. {linkedapi-1.3.3 → linkedapi-1.3.5}/pyproject.toml +1 -1
  14. {linkedapi-1.3.3 → linkedapi-1.3.5}/tests/test_errors.py +2 -0
  15. {linkedapi-1.3.3 → linkedapi-1.3.5}/tests/test_operations.py +42 -1
  16. linkedapi-1.3.3/linkedapi/operations/comment_on_post.py +0 -12
  17. {linkedapi-1.3.3 → linkedapi-1.3.5}/.github/workflows/publish.yaml +0 -0
  18. {linkedapi-1.3.3 → linkedapi-1.3.5}/.gitignore +0 -0
  19. {linkedapi-1.3.3 → linkedapi-1.3.5}/LICENSE +0 -0
  20. {linkedapi-1.3.3 → linkedapi-1.3.5}/README.md +0 -0
  21. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/admin/__init__.py +0 -0
  22. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/admin/accounts.py +0 -0
  23. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/admin/admin.py +0 -0
  24. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/admin/http_client.py +0 -0
  25. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/admin/limits.py +0 -0
  26. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/admin/subscription.py +0 -0
  27. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/admin/webhooks.py +0 -0
  28. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/config.py +0 -0
  29. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/core/__init__.py +0 -0
  30. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/core/operation.py +0 -0
  31. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/core/polling.py +0 -0
  32. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/http/__init__.py +0 -0
  33. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/http/base.py +0 -0
  34. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/http/linked_api_http_client.py +0 -0
  35. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/mappers/__init__.py +0 -0
  36. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/mappers/array.py +0 -0
  37. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/mappers/base.py +0 -0
  38. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/mappers/send_message.py +0 -0
  39. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/mappers/simple.py +0 -0
  40. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/mappers/then.py +0 -0
  41. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/mappers/void.py +0 -0
  42. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/accept_invitation.py +0 -0
  43. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/check_connection_status.py +0 -0
  44. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/create_post.py +0 -0
  45. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/custom_workflow.py +0 -0
  46. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/fetch_company.py +0 -0
  47. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/fetch_job.py +0 -0
  48. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/fetch_person.py +0 -0
  49. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/fetch_post.py +0 -0
  50. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/ignore_invitation.py +0 -0
  51. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/manage_conversation.py +0 -0
  52. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/nv_fetch_company.py +0 -0
  53. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/nv_fetch_person.py +0 -0
  54. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/nv_manage_conversation.py +0 -0
  55. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/nv_search_companies.py +0 -0
  56. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/nv_search_people.py +0 -0
  57. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/nv_send_message.py +0 -0
  58. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/nv_sync_conversation.py +0 -0
  59. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/nv_sync_inbox.py +0 -0
  60. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/react_to_post.py +0 -0
  61. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/remove_connection.py +0 -0
  62. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/retrieve_connections.py +0 -0
  63. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/retrieve_invitations.py +0 -0
  64. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/retrieve_pending_requests.py +0 -0
  65. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/retrieve_performance.py +0 -0
  66. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/retrieve_ssi.py +0 -0
  67. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/search_companies.py +0 -0
  68. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/search_jobs.py +0 -0
  69. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/search_people.py +0 -0
  70. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/send_connection_request.py +0 -0
  71. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/send_message.py +0 -0
  72. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/sync_conversation.py +0 -0
  73. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/sync_inbox.py +0 -0
  74. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/sync_network.py +0 -0
  75. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/withdraw_connection_request.py +0 -0
  76. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/py.typed +0 -0
  77. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/types/account.py +0 -0
  78. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/types/admin/__init__.py +0 -0
  79. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/types/admin/accounts.py +0 -0
  80. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/types/admin/config.py +0 -0
  81. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/types/admin/limits.py +0 -0
  82. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/types/admin/subscription.py +0 -0
  83. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/types/base.py +0 -0
  84. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/types/company.py +0 -0
  85. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/types/connection.py +0 -0
  86. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/types/jobs.py +0 -0
  87. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/types/message.py +0 -0
  88. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/types/network.py +0 -0
  89. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/types/params.py +0 -0
  90. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/types/person.py +0 -0
  91. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/types/responses.py +0 -0
  92. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/types/search_companies.py +0 -0
  93. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/types/search_people.py +0 -0
  94. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/types/statistics.py +0 -0
  95. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/types/webhooks.py +0 -0
  96. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/types/workflow.py +0 -0
  97. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/webhooks/__init__.py +0 -0
  98. {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/webhooks/parse.py +0 -0
  99. {linkedapi-1.3.3 → linkedapi-1.3.5}/tests/conftest.py +0 -0
  100. {linkedapi-1.3.3 → linkedapi-1.3.5}/tests/test_admin.py +0 -0
  101. {linkedapi-1.3.3 → linkedapi-1.3.5}/tests/test_direct_methods.py +0 -0
  102. {linkedapi-1.3.3 → linkedapi-1.3.5}/tests/test_http_client.py +0 -0
  103. {linkedapi-1.3.3 → linkedapi-1.3.5}/tests/test_mappers.py +0 -0
  104. {linkedapi-1.3.3 → linkedapi-1.3.5}/tests/test_models.py +0 -0
  105. {linkedapi-1.3.3 → linkedapi-1.3.5}/tests/test_polling.py +0 -0
  106. {linkedapi-1.3.3 → linkedapi-1.3.5}/tests/test_webhooks.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: linkedapi
3
- Version: 1.3.3
3
+ Version: 1.3.5
4
4
  Summary: Official synchronous Python SDK for Linked API.
5
5
  Project-URL: Homepage, https://linkedapi.io
6
6
  Project-URL: Repository, https://github.com/Linked-API/linkedapi-python
@@ -54,9 +54,12 @@ from linkedapi.operations import (
54
54
  NvSendMessage,
55
55
  NvSyncConversation,
56
56
  NvSyncInbox,
57
+ ReactToComment,
57
58
  ReactToPost,
58
59
  RemoveConnection,
60
+ ReplyToComment,
59
61
  RetrieveConnections,
62
+ RetrieveFeed,
60
63
  RetrieveInvitations,
61
64
  RetrievePendingRequests,
62
65
  RetrievePerformance,
@@ -75,7 +78,7 @@ from linkedapi.types import * # noqa: F403
75
78
  from linkedapi.types import __all__ as _types_all
76
79
  from linkedapi.webhooks import parse_webhook_event
77
80
 
78
- __version__ = "1.3.2"
81
+ __version__ = "1.3.5"
79
82
  PredefinedOperation = Operation
80
83
 
81
84
  __all__ = [
@@ -127,11 +130,14 @@ __all__ = [
127
130
  "NvSyncInbox",
128
131
  "Operation",
129
132
  "PredefinedOperation",
133
+ "ReactToComment",
130
134
  "ReactToPost",
131
135
  "RemoveConnection",
136
+ "ReplyToComment",
132
137
  "ResponseMapping",
133
138
  "RetrieveInvitations",
134
139
  "RetrieveConnections",
140
+ "RetrieveFeed",
135
141
  "RetrievePendingRequests",
136
142
  "RetrievePerformance",
137
143
  "RetrieveSSI",
@@ -27,9 +27,12 @@ from linkedapi.operations import (
27
27
  NvSendMessage,
28
28
  NvSyncConversation,
29
29
  NvSyncInbox,
30
+ ReactToComment,
30
31
  ReactToPost,
31
32
  RemoveConnection,
33
+ ReplyToComment,
32
34
  RetrieveConnections,
35
+ RetrieveFeed,
33
36
  RetrieveInvitations,
34
37
  RetrievePendingRequests,
35
38
  RetrievePerformance,
@@ -89,7 +92,10 @@ class LinkedApi:
89
92
  self.fetch_job = FetchJob(self.http_client)
90
93
  self.react_to_post = ReactToPost(self.http_client)
91
94
  self.comment_on_post = CommentOnPost(self.http_client)
95
+ self.react_to_comment = ReactToComment(self.http_client)
96
+ self.reply_to_comment = ReplyToComment(self.http_client)
92
97
  self.create_post = CreatePost(self.http_client)
98
+ self.retrieve_feed = RetrieveFeed(self.http_client)
93
99
  self.retrieve_ssi = RetrieveSSI(self.http_client)
94
100
  self.retrieve_performance = RetrievePerformance(self.http_client)
95
101
  self.nv_send_message = NvSendMessage(self.http_client)
@@ -126,7 +132,10 @@ class LinkedApi:
126
132
  self.fetch_job,
127
133
  self.react_to_post,
128
134
  self.comment_on_post,
135
+ self.react_to_comment,
136
+ self.reply_to_comment,
129
137
  self.create_post,
138
+ self.retrieve_feed,
130
139
  self.retrieve_ssi,
131
140
  self.retrieve_performance,
132
141
  self.nv_send_message,
@@ -20,6 +20,8 @@ LinkedApiActionErrorType = Literal[
20
20
  "postNotFound",
21
21
  "jobNotFound",
22
22
  "commentingNotAllowed",
23
+ "commentNotFound",
24
+ "replyingNotAllowed",
23
25
  "noPostingPermission",
24
26
  "noSalesNavigator",
25
27
  "conversationsNotSynced",
@@ -43,6 +45,8 @@ LINKED_API_ACTION_ERROR_TYPES: tuple[str, ...] = (
43
45
  "postNotFound",
44
46
  "jobNotFound",
45
47
  "commentingNotAllowed",
48
+ "commentNotFound",
49
+ "replyingNotAllowed",
46
50
  "noPostingPermission",
47
51
  "noSalesNavigator",
48
52
  "conversationsNotSynced",
@@ -17,9 +17,12 @@ from linkedapi.operations.nv_search_people import NvSearchPeople
17
17
  from linkedapi.operations.nv_send_message import NvSendMessage
18
18
  from linkedapi.operations.nv_sync_conversation import NvSyncConversation
19
19
  from linkedapi.operations.nv_sync_inbox import NvSyncInbox
20
+ from linkedapi.operations.react_to_comment import ReactToComment
20
21
  from linkedapi.operations.react_to_post import ReactToPost
21
22
  from linkedapi.operations.remove_connection import RemoveConnection
23
+ from linkedapi.operations.reply_to_comment import ReplyToComment
22
24
  from linkedapi.operations.retrieve_connections import RetrieveConnections
25
+ from linkedapi.operations.retrieve_feed import RetrieveFeed
23
26
  from linkedapi.operations.retrieve_invitations import RetrieveInvitations
24
27
  from linkedapi.operations.retrieve_pending_requests import RetrievePendingRequests
25
28
  from linkedapi.operations.retrieve_performance import RetrievePerformance
@@ -60,9 +63,12 @@ __all__ = [
60
63
  "NvSendMessage",
61
64
  "NvSyncConversation",
62
65
  "NvSyncInbox",
66
+ "ReactToComment",
63
67
  "ReactToPost",
64
68
  "RemoveConnection",
69
+ "ReplyToComment",
65
70
  "RetrieveConnections",
71
+ "RetrieveFeed",
66
72
  "RetrieveInvitations",
67
73
  "RetrievePendingRequests",
68
74
  "RetrievePerformance",
@@ -0,0 +1,15 @@
1
+ from __future__ import annotations
2
+
3
+ from linkedapi.core import Operation
4
+ from linkedapi.mappers import SimpleWorkflowMapper
5
+ from linkedapi.types import CommentOnPostParams, CommentResult
6
+
7
+
8
+ class CommentOnPost(Operation[CommentOnPostParams, CommentResult]):
9
+ """Comment on a LinkedIn post."""
10
+
11
+ operation_name = "commentOnPost"
12
+ mapper = SimpleWorkflowMapper[CommentOnPostParams, CommentResult](
13
+ "st.commentOnPost",
14
+ result_model=CommentResult,
15
+ )
@@ -0,0 +1,12 @@
1
+ from __future__ import annotations
2
+
3
+ from linkedapi.core import Operation
4
+ from linkedapi.mappers import VoidWorkflowMapper
5
+ from linkedapi.types import ReactToCommentParams
6
+
7
+
8
+ class ReactToComment(Operation[ReactToCommentParams, None]):
9
+ """React to a LinkedIn comment."""
10
+
11
+ operation_name = "reactToComment"
12
+ mapper = VoidWorkflowMapper[ReactToCommentParams]("st.reactToComment")
@@ -0,0 +1,15 @@
1
+ from __future__ import annotations
2
+
3
+ from linkedapi.core import Operation
4
+ from linkedapi.mappers import SimpleWorkflowMapper
5
+ from linkedapi.types import CommentResult, ReplyToCommentParams
6
+
7
+
8
+ class ReplyToComment(Operation[ReplyToCommentParams, CommentResult]):
9
+ """Reply to a LinkedIn comment."""
10
+
11
+ operation_name = "replyToComment"
12
+ mapper = SimpleWorkflowMapper[ReplyToCommentParams, CommentResult](
13
+ "st.replyToComment",
14
+ result_model=CommentResult,
15
+ )
@@ -0,0 +1,15 @@
1
+ from __future__ import annotations
2
+
3
+ from linkedapi.core import Operation
4
+ from linkedapi.mappers import ArrayWorkflowMapper
5
+ from linkedapi.types import FeedPost, RetrieveFeedParams
6
+
7
+
8
+ class RetrieveFeed(Operation[RetrieveFeedParams, list[FeedPost]]):
9
+ """Retrieve posts from the current account's LinkedIn home feed."""
10
+
11
+ operation_name = "retrieveFeed"
12
+ mapper = ArrayWorkflowMapper[RetrieveFeedParams, FeedPost](
13
+ "st.retrieveFeed",
14
+ FeedPost,
15
+ )
@@ -87,6 +87,7 @@ from linkedapi.types.connection import (
87
87
  SendConnectionRequestParams,
88
88
  WithdrawConnectionRequestParams,
89
89
  )
90
+ from linkedapi.types.feed import FeedPost, RetrieveFeedParams
90
91
  from linkedapi.types.jobs import (
91
92
  FetchJobParams,
92
93
  FetchJobResult,
@@ -148,6 +149,8 @@ from linkedapi.types.post import (
148
149
  BaseFetchPostParamsWide,
149
150
  Comment,
150
151
  CommentOnPostParams,
152
+ CommentOnPostResult,
153
+ CommentResult,
151
154
  CreatePostAttachment,
152
155
  CreatePostParams,
153
156
  CreatePostResult,
@@ -167,7 +170,10 @@ from linkedapi.types.post import (
167
170
  PostType,
168
171
  Reaction,
169
172
  ReactionType,
173
+ ReactToCommentParams,
170
174
  ReactToPostParams,
175
+ ReplyToCommentParams,
176
+ ReplyToCommentResult,
171
177
  )
172
178
  from linkedapi.types.responses import LinkedApiRequestError, LinkedApiResponse
173
179
  from linkedapi.types.search_companies import (
@@ -261,6 +267,8 @@ __all__ = [
261
267
  "CheckConnectionStatusResult",
262
268
  "Comment",
263
269
  "CommentOnPostParams",
270
+ "CommentOnPostResult",
271
+ "CommentResult",
264
272
  "Company",
265
273
  "ConnectionPerson",
266
274
  "ConnectionSession",
@@ -281,6 +289,7 @@ __all__ = [
281
289
  "DeleteWebhookParams",
282
290
  "DisconnectParams",
283
291
  "EmploymentType",
292
+ "FeedPost",
284
293
  "FetchCompanyParams",
285
294
  "FetchCompanyResult",
286
295
  "FetchJobParams",
@@ -370,6 +379,7 @@ __all__ = [
370
379
  "PostReactionsRetrievalConfig",
371
380
  "PostReposter",
372
381
  "PostType",
382
+ "ReactToCommentParams",
373
383
  "ReactToPostParams",
374
384
  "Reaction",
375
385
  "ReactionType",
@@ -379,10 +389,13 @@ __all__ = [
379
389
  "ReparseAccountInfoParams",
380
390
  "ReparseAccountInfoResult",
381
391
  "ReplayWebhookDeliveryParams",
392
+ "ReplyToCommentParams",
393
+ "ReplyToCommentResult",
382
394
  "ResetLimitsParams",
383
395
  "RetrieveConnectionsFilter",
384
396
  "RetrieveConnectionsParams",
385
397
  "RetrieveConnectionsResult",
398
+ "RetrieveFeedParams",
386
399
  "RetrievePendingRequestsResult",
387
400
  "RetrievePerformanceResult",
388
401
  "RetrieveSSIResult",
@@ -0,0 +1,14 @@
1
+ from __future__ import annotations
2
+
3
+ from pydantic import Field
4
+
5
+ from linkedapi.types.params import LimitParams
6
+ from linkedapi.types.post import Post
7
+
8
+
9
+ class FeedPost(Post):
10
+ feed_context: str | None = None
11
+
12
+
13
+ class RetrieveFeedParams(LimitParams):
14
+ limit: int | None = Field(default=None, ge=1, le=100)
@@ -40,7 +40,30 @@ class CommentOnPostParams(BaseActionParams):
40
40
  company_url: str | None = None
41
41
 
42
42
 
43
+ class CommentResult(LinkedApiModel):
44
+ comment_urn: str | None = None
45
+ comment_url: str | None = None
46
+
47
+
48
+ CommentOnPostResult: TypeAlias = CommentResult
49
+
50
+
51
+ class ReactToCommentParams(BaseActionParams):
52
+ comment_url: str
53
+ type: ReactionType = "like"
54
+
55
+
56
+ class ReplyToCommentParams(BaseActionParams):
57
+ comment_url: str
58
+ text: str
59
+
60
+
61
+ ReplyToCommentResult: TypeAlias = CommentResult
62
+
63
+
43
64
  class PostComment(LinkedApiModel):
65
+ comment_urn: str | None = None
66
+ comment_url: str | None = None
44
67
  commenter_url: str | None = None
45
68
  commenter_name: str | None = None
46
69
  commenter_headline: str | None = None
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "linkedapi"
7
- version = "1.3.3"
7
+ version = "1.3.5"
8
8
  description = "Official synchronous Python SDK for Linked API."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -47,6 +47,8 @@ def test_error_type_sets_match_node_contract() -> None:
47
47
  "postNotFound",
48
48
  "jobNotFound",
49
49
  "commentingNotAllowed",
50
+ "commentNotFound",
51
+ "replyingNotAllowed",
50
52
  "noPostingPermission",
51
53
  "noSalesNavigator",
52
54
  "conversationsNotSynced",
@@ -7,10 +7,13 @@ from pydantic import ValidationError
7
7
  from linkedapi import (
8
8
  AcceptInvitationParams,
9
9
  ArrayWorkflowMapper,
10
+ FeedPost,
10
11
  FetchPersonParams,
11
12
  Invitation,
12
13
  LinkedApi,
13
14
  LinkedApiConfig,
15
+ RetrieveFeedParams,
16
+ SimpleWorkflowMapper,
14
17
  VoidWorkflowMapper,
15
18
  )
16
19
 
@@ -38,6 +41,7 @@ def test_linked_api_exposes_all_predefined_operations() -> None:
38
41
  "retrieve_pending_requests",
39
42
  "retrieve_invitations",
40
43
  "retrieve_connections",
44
+ "retrieve_feed",
41
45
  "remove_connection",
42
46
  "send_message",
43
47
  "sync_conversation",
@@ -50,6 +54,8 @@ def test_linked_api_exposes_all_predefined_operations() -> None:
50
54
  "nv_manage_conversation",
51
55
  "react_to_post",
52
56
  "comment_on_post",
57
+ "react_to_comment",
58
+ "reply_to_comment",
53
59
  "create_post",
54
60
  "retrieve_ssi",
55
61
  "retrieve_performance",
@@ -60,7 +66,7 @@ def test_linked_api_exposes_all_predefined_operations() -> None:
60
66
  assert hasattr(operation, "execute")
61
67
  assert hasattr(operation, "result")
62
68
  assert hasattr(operation, "cancel")
63
- assert len(linkedapi.operations) == 35
69
+ assert len(linkedapi.operations) == 38
64
70
 
65
71
 
66
72
  def test_operation_mappers_match_node_contract() -> None:
@@ -82,6 +88,8 @@ def test_operation_mappers_match_node_contract() -> None:
82
88
  assert linkedapi.ignore_invitation.mapper.action_type == "st.ignoreInvitation"
83
89
  assert isinstance(linkedapi.retrieve_invitations.mapper, ArrayWorkflowMapper)
84
90
  assert linkedapi.retrieve_invitations.mapper.base_action_type == "st.retrieveInvitations"
91
+ assert isinstance(linkedapi.retrieve_feed.mapper, ArrayWorkflowMapper)
92
+ assert linkedapi.retrieve_feed.mapper.base_action_type == "st.retrieveFeed"
85
93
  assert isinstance(linkedapi.sync_inbox.mapper, VoidWorkflowMapper)
86
94
  assert linkedapi.sync_inbox.mapper.action_type == "st.syncInbox"
87
95
  assert isinstance(linkedapi.nv_sync_inbox.mapper, VoidWorkflowMapper)
@@ -90,6 +98,39 @@ def test_operation_mappers_match_node_contract() -> None:
90
98
  assert linkedapi.manage_conversation.mapper.action_type == "st.manageConversation"
91
99
  assert isinstance(linkedapi.nv_manage_conversation.mapper, VoidWorkflowMapper)
92
100
  assert linkedapi.nv_manage_conversation.mapper.action_type == "nv.manageConversation"
101
+ assert isinstance(linkedapi.react_to_comment.mapper, VoidWorkflowMapper)
102
+ assert linkedapi.react_to_comment.mapper.action_type == "st.reactToComment"
103
+ assert isinstance(linkedapi.comment_on_post.mapper, SimpleWorkflowMapper)
104
+ assert linkedapi.comment_on_post.mapper.action_type == "st.commentOnPost"
105
+ assert isinstance(linkedapi.reply_to_comment.mapper, SimpleWorkflowMapper)
106
+ assert linkedapi.reply_to_comment.mapper.action_type == "st.replyToComment"
107
+
108
+
109
+ def test_retrieve_feed_maps_params_and_feed_context() -> None:
110
+ linkedapi = LinkedApi(LinkedApiConfig(linked_api_token="x", identification_token="y"))
111
+
112
+ request = linkedapi.retrieve_feed.mapper.map_request(RetrieveFeedParams(limit=25))
113
+ response = linkedapi.retrieve_feed.mapper.map_response(
114
+ {
115
+ "actionType": "st.retrieveFeed",
116
+ "success": True,
117
+ "data": [
118
+ {
119
+ "url": "https://www.linkedin.com/feed/update/urn:li:activity:1",
120
+ "feedContext": "Example Person reacted to this",
121
+ }
122
+ ],
123
+ }
124
+ )
125
+
126
+ assert request == {"actionType": "st.retrieveFeed", "limit": 25}
127
+ assert response.data is not None
128
+ assert isinstance(response.data[0], FeedPost)
129
+ assert response.data[0].feed_context == "Example Person reacted to this"
130
+
131
+ for invalid_limit in (0, 101):
132
+ with pytest.raises(ValidationError):
133
+ RetrieveFeedParams(limit=invalid_limit)
93
134
 
94
135
 
95
136
  def test_invitation_params_require_the_matching_target_url() -> None:
@@ -1,12 +0,0 @@
1
- from __future__ import annotations
2
-
3
- from linkedapi.core import Operation
4
- from linkedapi.mappers import VoidWorkflowMapper
5
- from linkedapi.types import CommentOnPostParams
6
-
7
-
8
- class CommentOnPost(Operation[CommentOnPostParams, None]):
9
- """Comment on a LinkedIn post."""
10
-
11
- operation_name = "commentOnPost"
12
- mapper = VoidWorkflowMapper[CommentOnPostParams]("st.commentOnPost")
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes