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.
- {linkedapi-1.3.3 → linkedapi-1.3.5}/PKG-INFO +1 -1
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/__init__.py +7 -1
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/client.py +9 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/errors.py +4 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/__init__.py +6 -0
- linkedapi-1.3.5/linkedapi/operations/comment_on_post.py +15 -0
- linkedapi-1.3.5/linkedapi/operations/react_to_comment.py +12 -0
- linkedapi-1.3.5/linkedapi/operations/reply_to_comment.py +15 -0
- linkedapi-1.3.5/linkedapi/operations/retrieve_feed.py +15 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/types/__init__.py +13 -0
- linkedapi-1.3.5/linkedapi/types/feed.py +14 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/types/post.py +23 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/pyproject.toml +1 -1
- {linkedapi-1.3.3 → linkedapi-1.3.5}/tests/test_errors.py +2 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/tests/test_operations.py +42 -1
- linkedapi-1.3.3/linkedapi/operations/comment_on_post.py +0 -12
- {linkedapi-1.3.3 → linkedapi-1.3.5}/.github/workflows/publish.yaml +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/.gitignore +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/LICENSE +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/README.md +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/admin/__init__.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/admin/accounts.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/admin/admin.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/admin/http_client.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/admin/limits.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/admin/subscription.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/admin/webhooks.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/config.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/core/__init__.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/core/operation.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/core/polling.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/http/__init__.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/http/base.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/http/linked_api_http_client.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/mappers/__init__.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/mappers/array.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/mappers/base.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/mappers/send_message.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/mappers/simple.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/mappers/then.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/mappers/void.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/accept_invitation.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/check_connection_status.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/create_post.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/custom_workflow.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/fetch_company.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/fetch_job.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/fetch_person.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/fetch_post.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/ignore_invitation.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/manage_conversation.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/nv_fetch_company.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/nv_fetch_person.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/nv_manage_conversation.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/nv_search_companies.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/nv_search_people.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/nv_send_message.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/nv_sync_conversation.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/nv_sync_inbox.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/react_to_post.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/remove_connection.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/retrieve_connections.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/retrieve_invitations.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/retrieve_pending_requests.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/retrieve_performance.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/retrieve_ssi.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/search_companies.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/search_jobs.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/search_people.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/send_connection_request.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/send_message.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/sync_conversation.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/sync_inbox.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/sync_network.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/operations/withdraw_connection_request.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/py.typed +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/types/account.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/types/admin/__init__.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/types/admin/accounts.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/types/admin/config.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/types/admin/limits.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/types/admin/subscription.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/types/base.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/types/company.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/types/connection.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/types/jobs.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/types/message.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/types/network.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/types/params.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/types/person.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/types/responses.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/types/search_companies.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/types/search_people.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/types/statistics.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/types/webhooks.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/types/workflow.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/webhooks/__init__.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/linkedapi/webhooks/parse.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/tests/conftest.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/tests/test_admin.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/tests/test_direct_methods.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/tests/test_http_client.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/tests/test_mappers.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/tests/test_models.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/tests/test_polling.py +0 -0
- {linkedapi-1.3.3 → linkedapi-1.3.5}/tests/test_webhooks.py +0 -0
|
@@ -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.
|
|
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
|
|
@@ -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) ==
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|