linkedapi 1.5.0__tar.gz → 1.6.1__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.5.0 → linkedapi-1.6.1}/PKG-INFO +1 -1
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/__init__.py +1 -1
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/client.py +93 -2
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/errors.py +6 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/fetch_person.py +2 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/types/__init__.py +36 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/types/nv_alerts.py +3 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/types/person.py +16 -0
- linkedapi-1.6.1/linkedapi/types/signals.py +152 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/types/webhooks.py +47 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/webhooks/parse.py +3 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/pyproject.toml +1 -1
- {linkedapi-1.5.0 → linkedapi-1.6.1}/tests/test_errors.py +3 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/tests/test_open_vocabularies.py +15 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/tests/test_operations.py +61 -0
- linkedapi-1.6.1/tests/test_signals.py +280 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/.github/workflows/publish.yaml +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/.gitignore +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/LICENSE +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/README.md +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/examples/verify_webhook_signature.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/admin/__init__.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/admin/accounts.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/admin/admin.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/admin/http_client.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/admin/limits.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/admin/subscription.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/admin/webhooks.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/changelog.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/config.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/core/__init__.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/core/operation.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/core/polling.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/http/__init__.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/http/base.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/http/linked_api_http_client.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/mappers/__init__.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/mappers/array.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/mappers/base.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/mappers/endorse_person_skills.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/mappers/send_message.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/mappers/simple.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/mappers/then.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/mappers/void.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/__init__.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/accept_invitation.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/check_connection_status.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/comment_on_post.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/create_post.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/create_repost.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/custom_workflow.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/endorse_person_skill.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/endorse_person_skills.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/fetch_company.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/fetch_job.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/fetch_post.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/ignore_invitation.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/manage_conversation.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/nv_create_list.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/nv_create_saved_search.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/nv_delete_list.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/nv_delete_saved_search.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/nv_fetch_company.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/nv_fetch_person.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/nv_manage_conversation.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/nv_remove_account_from_list.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/nv_remove_lead_from_list.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/nv_rename_list.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/nv_retrieve_alerts.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/nv_retrieve_list_accounts.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/nv_retrieve_list_leads.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/nv_retrieve_lists.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/nv_retrieve_saved_searches.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/nv_save_account.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/nv_save_lead.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/nv_search_companies.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/nv_search_people.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/nv_send_message.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/nv_sync_conversation.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/nv_sync_inbox.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/nv_unsave_account.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/nv_unsave_lead.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/rc_archive_project.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/rc_create_project.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/rc_fetch_person.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/rc_rename_project.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/rc_retrieve_project_candidates.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/rc_retrieve_projects.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/rc_save_to_project.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/rc_search_people.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/rc_send_message.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/rc_sync_inbox.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/react_to_comment.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/react_to_post.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/remove_connection.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/reply_to_comment.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/retrieve_connections.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/retrieve_feed.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/retrieve_invitations.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/retrieve_pending_requests.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/retrieve_performance.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/retrieve_profile_viewers.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/retrieve_ssi.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/search_companies.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/search_jobs.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/search_people.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/search_posts.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/send_connection_request.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/send_message.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/sync_conversation.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/sync_inbox.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/sync_network.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/operations/withdraw_connection_request.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/py.typed +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/types/account.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/types/admin/__init__.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/types/admin/accounts.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/types/admin/config.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/types/admin/limits.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/types/admin/subscription.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/types/base.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/types/changelog.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/types/company.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/types/connection.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/types/feed.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/types/jobs.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/types/message.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/types/network.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/types/nv_list_management.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/types/nv_list_members.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/types/nv_saved_searches.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/types/nv_saved_subjects.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/types/params.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/types/post.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/types/profile_viewers.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/types/rc_people.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/types/rc_projects.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/types/responses.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/types/search_companies.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/types/search_people.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/types/search_posts.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/types/statistics.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/types/viewer_state.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/types/workflow.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/webhooks/__init__.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/webhooks/headers.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/linkedapi/webhooks/signature.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/tests/conftest.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/tests/test_admin.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/tests/test_admin_webhooks.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/tests/test_changelog.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/tests/test_direct_methods.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/tests/test_endorse_operations.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/tests/test_http_client.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/tests/test_limits_categories.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/tests/test_mappers.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/tests/test_models.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/tests/test_nv_backlog.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/tests/test_nv_list_management.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/tests/test_nv_retrieve_alerts.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/tests/test_nv_saved_subjects.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/tests/test_polling.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/tests/test_rc_operations.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/tests/test_webhook_signature.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/tests/test_webhooks.py +0 -0
- {linkedapi-1.5.0 → linkedapi-1.6.1}/tests/test_working_hours_contract.py +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
from typing import Any, overload
|
|
4
|
-
from urllib.parse import urlencode
|
|
4
|
+
from urllib.parse import quote, urlencode
|
|
5
5
|
|
|
6
6
|
from linkedapi.config import LinkedApiConfig
|
|
7
7
|
from linkedapi.errors import LinkedApiError
|
|
@@ -78,7 +78,7 @@ from linkedapi.operations import (
|
|
|
78
78
|
SyncNetwork,
|
|
79
79
|
WithdrawConnectionRequest,
|
|
80
80
|
)
|
|
81
|
-
from linkedapi.types import AccountInfo, LinkedApiActionError, serialize_value
|
|
81
|
+
from linkedapi.types import AccountInfo, LinkedApiActionError, LinkedApiResponse, serialize_value
|
|
82
82
|
from linkedapi.types.message import (
|
|
83
83
|
ConversationPollRequest,
|
|
84
84
|
ConversationPollResult,
|
|
@@ -88,6 +88,14 @@ from linkedapi.types.message import (
|
|
|
88
88
|
InboxPollRequest,
|
|
89
89
|
)
|
|
90
90
|
from linkedapi.types.network import NetworkEvent, NetworkPollRequest
|
|
91
|
+
from linkedapi.types.signals import (
|
|
92
|
+
CreateSignalParams,
|
|
93
|
+
GetSignalsParams,
|
|
94
|
+
Signal,
|
|
95
|
+
SignalEvent,
|
|
96
|
+
SignalIdParams,
|
|
97
|
+
SignalPollRequest,
|
|
98
|
+
)
|
|
91
99
|
from linkedapi.types.statistics import ApiUsageAction, ApiUsageParams
|
|
92
100
|
|
|
93
101
|
|
|
@@ -352,6 +360,75 @@ class LinkedApi:
|
|
|
352
360
|
],
|
|
353
361
|
)
|
|
354
362
|
|
|
363
|
+
def create_signal(self, params: CreateSignalParams) -> MappedResponse[Signal]:
|
|
364
|
+
"""Create a signal: one thing for the account to watch on LinkedIn.
|
|
365
|
+
|
|
366
|
+
Creating a signal that already exists on the account returns that signal instead of a
|
|
367
|
+
second one. Raises LinkedApiError "invalidRequestPayload" or "signalLimitReached".
|
|
368
|
+
"""
|
|
369
|
+
|
|
370
|
+
result = _signal_result(self.http_client.post("/signals", serialize_value(params)))
|
|
371
|
+
return MappedResponse(data=Signal.model_validate(result), errors=[])
|
|
372
|
+
|
|
373
|
+
def get_signals(self, params: GetSignalsParams | None = None) -> MappedResponse[list[Signal]]:
|
|
374
|
+
"""List the account's signals, optionally only those of one type or status."""
|
|
375
|
+
|
|
376
|
+
query = urlencode(serialize_value(params) if params is not None else {})
|
|
377
|
+
result = _signal_result(self.http_client.get(f"/signals?{query}" if query else "/signals"))
|
|
378
|
+
return MappedResponse(
|
|
379
|
+
data=[Signal.model_validate(item) for item in result.get("signals", [])],
|
|
380
|
+
errors=[],
|
|
381
|
+
)
|
|
382
|
+
|
|
383
|
+
def get_signal(self, params: SignalIdParams) -> MappedResponse[Signal]:
|
|
384
|
+
"""Retrieve one signal. Raises LinkedApiError "signalNotFound"."""
|
|
385
|
+
|
|
386
|
+
result = _signal_result(self.http_client.get(_signal_path(params.signal_id)))
|
|
387
|
+
return MappedResponse(data=Signal.model_validate(result), errors=[])
|
|
388
|
+
|
|
389
|
+
def pause_signal(self, params: SignalIdParams) -> MappedResponse[Signal]:
|
|
390
|
+
"""Pause a signal. A paused signal is not checked; its events stay available.
|
|
391
|
+
|
|
392
|
+
Raises LinkedApiError "signalNotFound" or "signalStopped".
|
|
393
|
+
"""
|
|
394
|
+
|
|
395
|
+
result = _signal_result(self.http_client.post(f"{_signal_path(params.signal_id)}/pause"))
|
|
396
|
+
return MappedResponse(data=Signal.model_validate(result), errors=[])
|
|
397
|
+
|
|
398
|
+
def resume_signal(self, params: SignalIdParams) -> MappedResponse[Signal]:
|
|
399
|
+
"""Resume a paused signal. Its first check reports what appeared while it was paused, as
|
|
400
|
+
far as LinkedIn still shows it.
|
|
401
|
+
|
|
402
|
+
Raises LinkedApiError "signalNotFound", "signalStopped" or "signalLimitReached".
|
|
403
|
+
"""
|
|
404
|
+
|
|
405
|
+
result = _signal_result(self.http_client.post(f"{_signal_path(params.signal_id)}/resume"))
|
|
406
|
+
return MappedResponse(data=Signal.model_validate(result), errors=[])
|
|
407
|
+
|
|
408
|
+
def delete_signal(self, params: SignalIdParams) -> MappedResponse[bool]:
|
|
409
|
+
"""Delete a signal. Its checks stop at once; the events it produced stay available
|
|
410
|
+
through poll_signals. Raises LinkedApiError "signalNotFound"."""
|
|
411
|
+
|
|
412
|
+
result = _signal_result(self.http_client.delete(_signal_path(params.signal_id)))
|
|
413
|
+
return MappedResponse(data=result.get("deleted") is True, errors=[])
|
|
414
|
+
|
|
415
|
+
def poll_signals(
|
|
416
|
+
self,
|
|
417
|
+
request: SignalPollRequest | None = None,
|
|
418
|
+
) -> MappedResponse[list[SignalEvent]]:
|
|
419
|
+
"""Read the events your signals detected, newest first.
|
|
420
|
+
|
|
421
|
+
Pass "since": without it every retained event is returned. On each next request pass the
|
|
422
|
+
"detected_at" of the newest event you have, and process each event once by its "id".
|
|
423
|
+
"""
|
|
424
|
+
|
|
425
|
+
payload = serialize_value(request) if request is not None else {}
|
|
426
|
+
result = _signal_result(self.http_client.post("/signals/poll", payload))
|
|
427
|
+
return MappedResponse(
|
|
428
|
+
data=[SignalEvent.model_validate(item) for item in result.get("events", [])],
|
|
429
|
+
errors=[],
|
|
430
|
+
)
|
|
431
|
+
|
|
355
432
|
def get_account_info(self) -> MappedResponse[AccountInfo]:
|
|
356
433
|
"""Retrieve basic information about the current LinkedIn account."""
|
|
357
434
|
|
|
@@ -377,3 +454,17 @@ class LinkedApi:
|
|
|
377
454
|
response.error.type if response.error else "httpError",
|
|
378
455
|
response.error.message if response.error else "",
|
|
379
456
|
)
|
|
457
|
+
|
|
458
|
+
|
|
459
|
+
# Signal ids are opaque ("sigsub-..."), so they are quoted rather than validated.
|
|
460
|
+
def _signal_path(signal_id: str) -> str:
|
|
461
|
+
return f"/signals/{quote(signal_id, safe='')}"
|
|
462
|
+
|
|
463
|
+
|
|
464
|
+
def _signal_result(response: LinkedApiResponse[Any]) -> Any:
|
|
465
|
+
if response.success and response.result is not None:
|
|
466
|
+
return response.result
|
|
467
|
+
raise LinkedApiError(
|
|
468
|
+
response.error.type if response.error else "httpError",
|
|
469
|
+
response.error.message if response.error else "",
|
|
470
|
+
)
|
|
@@ -155,6 +155,9 @@ LinkedApiErrorType = Literal[
|
|
|
155
155
|
"sessionNotFound",
|
|
156
156
|
"noAvailableSeats",
|
|
157
157
|
"dailyConnectionAttemptsExceeded",
|
|
158
|
+
"signalLimitReached",
|
|
159
|
+
"signalNotFound",
|
|
160
|
+
"signalStopped",
|
|
158
161
|
]
|
|
159
162
|
LINKED_API_ERROR_TYPES: tuple[str, ...] = (
|
|
160
163
|
"linkedApiTokenRequired",
|
|
@@ -180,6 +183,9 @@ LINKED_API_ERROR_TYPES: tuple[str, ...] = (
|
|
|
180
183
|
"sessionNotFound",
|
|
181
184
|
"noAvailableSeats",
|
|
182
185
|
"dailyConnectionAttemptsExceeded",
|
|
186
|
+
"signalLimitReached",
|
|
187
|
+
"signalNotFound",
|
|
188
|
+
"signalStopped",
|
|
183
189
|
)
|
|
184
190
|
|
|
185
191
|
|
|
@@ -13,6 +13,7 @@ class FetchPersonMapper(ThenWorkflowMapper[FetchPersonParams, Person]):
|
|
|
13
13
|
ActionConfig("retrieve_education", "st.retrievePersonEducation"),
|
|
14
14
|
ActionConfig("retrieve_skills", "st.retrievePersonSkills"),
|
|
15
15
|
ActionConfig("retrieve_languages", "st.retrievePersonLanguages"),
|
|
16
|
+
ActionConfig("retrieve_contact_info", "st.retrievePersonContactInfo"),
|
|
16
17
|
ActionConfig("retrieve_posts", "st.retrievePersonPosts", "posts_retrieval_config"),
|
|
17
18
|
ActionConfig(
|
|
18
19
|
"retrieve_comments", "st.retrievePersonComments", "comments_retrieval_config"
|
|
@@ -26,6 +27,7 @@ class FetchPersonMapper(ThenWorkflowMapper[FetchPersonParams, Person]):
|
|
|
26
27
|
ResponseMapping("st.retrievePersonEducation", "education"),
|
|
27
28
|
ResponseMapping("st.retrievePersonSkills", "skills"),
|
|
28
29
|
ResponseMapping("st.retrievePersonLanguages", "languages"),
|
|
30
|
+
ResponseMapping("st.retrievePersonContactInfo", "contactInfo"),
|
|
29
31
|
ResponseMapping("st.retrievePersonPosts", "posts"),
|
|
30
32
|
ResponseMapping("st.retrievePersonComments", "comments"),
|
|
31
33
|
ResponseMapping("st.retrievePersonReactions", "reactions"),
|
|
@@ -188,6 +188,8 @@ from linkedapi.types.person import (
|
|
|
188
188
|
LanguageProficiency,
|
|
189
189
|
LocationType,
|
|
190
190
|
Person,
|
|
191
|
+
PersonBirthday,
|
|
192
|
+
PersonContactInfo,
|
|
191
193
|
PersonEducation,
|
|
192
194
|
PersonExperience,
|
|
193
195
|
PersonLanguage,
|
|
@@ -310,6 +312,21 @@ from linkedapi.types.search_posts import (
|
|
|
310
312
|
SearchPostsPersonFilter,
|
|
311
313
|
SearchPostsPersonFilterEntry,
|
|
312
314
|
)
|
|
315
|
+
from linkedapi.types.signals import (
|
|
316
|
+
CreateSignalParams,
|
|
317
|
+
GetSignalsParams,
|
|
318
|
+
Signal,
|
|
319
|
+
SignalComment,
|
|
320
|
+
SignalEvent,
|
|
321
|
+
SignalEventType,
|
|
322
|
+
SignalIdParams,
|
|
323
|
+
SignalPollRequest,
|
|
324
|
+
SignalPostSearchFilter,
|
|
325
|
+
SignalReaction,
|
|
326
|
+
SignalStatus,
|
|
327
|
+
SignalStoppedReason,
|
|
328
|
+
SignalType,
|
|
329
|
+
)
|
|
313
330
|
from linkedapi.types.statistics import (
|
|
314
331
|
ApiUsageAction,
|
|
315
332
|
ApiUsageParams,
|
|
@@ -340,6 +357,8 @@ from linkedapi.types.webhooks import (
|
|
|
340
357
|
SetWebhookParams,
|
|
341
358
|
SetWebhookPayloadModeParams,
|
|
342
359
|
SetWebhookSigningParams,
|
|
360
|
+
SignalWebhookEvent,
|
|
361
|
+
SignalWebhookEventData,
|
|
343
362
|
UnknownWebhookEvent,
|
|
344
363
|
WebhookDelivery,
|
|
345
364
|
WebhookDeliveryStatus,
|
|
@@ -420,6 +439,7 @@ __all__ = [
|
|
|
420
439
|
"CreateReconnectionSessionResult",
|
|
421
440
|
"CreateRepostParams",
|
|
422
441
|
"CreateRepostResult",
|
|
442
|
+
"CreateSignalParams",
|
|
423
443
|
"DeleteLimitEntry",
|
|
424
444
|
"DeleteLimitsParams",
|
|
425
445
|
"DeleteWebhookHeaderParams",
|
|
@@ -440,6 +460,7 @@ __all__ = [
|
|
|
440
460
|
"GetConnectionSessionParams",
|
|
441
461
|
"GetLimitsParams",
|
|
442
462
|
"GetLimitsUsageParams",
|
|
463
|
+
"GetSignalsParams",
|
|
443
464
|
"IgnoreInvitationParams",
|
|
444
465
|
"InboxMessage",
|
|
445
466
|
"InboxPersonMessage",
|
|
@@ -536,6 +557,8 @@ __all__ = [
|
|
|
536
557
|
"NvUnsaveLeadParams",
|
|
537
558
|
"PendingConnectionSession",
|
|
538
559
|
"Person",
|
|
560
|
+
"PersonBirthday",
|
|
561
|
+
"PersonContactInfo",
|
|
539
562
|
"PersonEducation",
|
|
540
563
|
"PersonExperience",
|
|
541
564
|
"PersonLanguage",
|
|
@@ -657,6 +680,19 @@ __all__ = [
|
|
|
657
680
|
"SetWebhookParams",
|
|
658
681
|
"SetWebhookPayloadModeParams",
|
|
659
682
|
"SetWebhookSigningParams",
|
|
683
|
+
"Signal",
|
|
684
|
+
"SignalComment",
|
|
685
|
+
"SignalEvent",
|
|
686
|
+
"SignalEventType",
|
|
687
|
+
"SignalIdParams",
|
|
688
|
+
"SignalPollRequest",
|
|
689
|
+
"SignalPostSearchFilter",
|
|
690
|
+
"SignalReaction",
|
|
691
|
+
"SignalStatus",
|
|
692
|
+
"SignalStoppedReason",
|
|
693
|
+
"SignalType",
|
|
694
|
+
"SignalWebhookEvent",
|
|
695
|
+
"SignalWebhookEventData",
|
|
660
696
|
"StCompanyDm",
|
|
661
697
|
"StCompanyEmployee",
|
|
662
698
|
"StCompanyEmployeesFilter",
|
|
@@ -10,6 +10,9 @@ from linkedapi.types.params import BaseActionParams
|
|
|
10
10
|
|
|
11
11
|
class NvRetrieveAlertsFilter(LinkedApiModel):
|
|
12
12
|
list_id: str | None = Field(default=None, pattern=r"^[1-9]\d*$")
|
|
13
|
+
# Subjects to keep, ORed: Sales Navigator identities or hashed URLs, or the
|
|
14
|
+
# "urn:li:member:<id>" / "urn:li:organization:<id>" values nv_retrieve_list_leads and
|
|
15
|
+
# nv_retrieve_list_accounts return.
|
|
13
16
|
subjects: list[str] | None = None
|
|
14
17
|
category: Literal["lead", "account"] | None = None
|
|
15
18
|
types: list[str] | None = None
|
|
@@ -34,6 +34,7 @@ class BaseFetchPersonParams(BaseActionParams):
|
|
|
34
34
|
retrieve_education: bool | None = None
|
|
35
35
|
retrieve_skills: bool | None = None
|
|
36
36
|
retrieve_languages: bool | None = None
|
|
37
|
+
retrieve_contact_info: bool | None = None
|
|
37
38
|
retrieve_posts: bool | None = None
|
|
38
39
|
retrieve_comments: bool | None = None
|
|
39
40
|
retrieve_reactions: bool | None = None
|
|
@@ -44,6 +45,7 @@ class BaseFetchPersonParamsWide(BaseFetchPersonParams):
|
|
|
44
45
|
retrieve_education: Literal[True] = True
|
|
45
46
|
retrieve_skills: Literal[True] = True
|
|
46
47
|
retrieve_languages: Literal[True] = True
|
|
48
|
+
retrieve_contact_info: Literal[True] = True
|
|
47
49
|
retrieve_posts: Literal[True] = True
|
|
48
50
|
retrieve_comments: Literal[True] = True
|
|
49
51
|
retrieve_reactions: Literal[True] = True
|
|
@@ -99,6 +101,19 @@ class PersonLanguage(BaseActionParams):
|
|
|
99
101
|
proficiency: LanguageProficiency | str | None = None
|
|
100
102
|
|
|
101
103
|
|
|
104
|
+
class PersonBirthday(BaseActionParams):
|
|
105
|
+
month: int | None = None
|
|
106
|
+
day: int | None = None
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
class PersonContactInfo(BaseActionParams):
|
|
110
|
+
email: str | None = None
|
|
111
|
+
phones: list[str] | None = None
|
|
112
|
+
websites: list[str] | None = None
|
|
113
|
+
birthday: PersonBirthday | None = None
|
|
114
|
+
connected_at: str | None = None
|
|
115
|
+
|
|
116
|
+
|
|
102
117
|
class Person(BaseActionParams):
|
|
103
118
|
name: str | None = None
|
|
104
119
|
urn: str | None = None
|
|
@@ -118,6 +133,7 @@ class Person(BaseActionParams):
|
|
|
118
133
|
education: list[PersonEducation] | None = None
|
|
119
134
|
skills: list[PersonSkill] | None = None
|
|
120
135
|
languages: list[PersonLanguage] | None = None
|
|
136
|
+
contact_info: PersonContactInfo | None = None
|
|
121
137
|
posts: list[Post] | None = None
|
|
122
138
|
comments: list[Comment] | None = None
|
|
123
139
|
reactions: list[Reaction] | None = None
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import Any, Literal
|
|
4
|
+
|
|
5
|
+
from pydantic import Field
|
|
6
|
+
|
|
7
|
+
from linkedapi.types.base import LinkedApiModel
|
|
8
|
+
from linkedapi.types.nv_alerts import NvAlert
|
|
9
|
+
from linkedapi.types.post import PostAuthor, PostComment, ReactionType
|
|
10
|
+
from linkedapi.types.profile_viewers import ProfileViewer
|
|
11
|
+
from linkedapi.types.search_posts import (
|
|
12
|
+
PostSearchContentType,
|
|
13
|
+
PostSearchPostedBy,
|
|
14
|
+
SearchPostResult,
|
|
15
|
+
SearchPostsCompanyFilterEntry,
|
|
16
|
+
SearchPostsPersonFilterEntry,
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
SignalType = Literal[
|
|
20
|
+
"personPosts",
|
|
21
|
+
"companyPosts",
|
|
22
|
+
"postSearch",
|
|
23
|
+
"postEngagement",
|
|
24
|
+
"network",
|
|
25
|
+
"profileViewers",
|
|
26
|
+
"listAlerts",
|
|
27
|
+
]
|
|
28
|
+
SignalStatus = Literal["active", "paused", "stopped"]
|
|
29
|
+
SignalStoppedReason = Literal[
|
|
30
|
+
"targetNotFound", "watchPeriodEnded", "noSalesNavigator", "listTooLarge"
|
|
31
|
+
]
|
|
32
|
+
SignalEventType = Literal[
|
|
33
|
+
"postPublished",
|
|
34
|
+
"postFound",
|
|
35
|
+
"commentAdded",
|
|
36
|
+
"reactionAdded",
|
|
37
|
+
"profileViewed",
|
|
38
|
+
"connectionAccepted",
|
|
39
|
+
"connectionAdded",
|
|
40
|
+
"connectionRequestReceived",
|
|
41
|
+
"alertPublished",
|
|
42
|
+
]
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
class SignalPostSearchFilter(LinkedApiModel):
|
|
46
|
+
"""The filters a "postSearch" signal accepts: the content search filters other than sort,
|
|
47
|
+
date and author."""
|
|
48
|
+
|
|
49
|
+
content_type: PostSearchContentType | None = None
|
|
50
|
+
posted_by: list[PostSearchPostedBy] | None = None
|
|
51
|
+
mentioning_members: list[SearchPostsPersonFilterEntry] | None = None
|
|
52
|
+
mentioning_companies: list[SearchPostsCompanyFilterEntry] | None = None
|
|
53
|
+
author_companies: list[SearchPostsCompanyFilterEntry] | None = None
|
|
54
|
+
author_industries: list[str] | None = None
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
class CreateSignalParams(LinkedApiModel):
|
|
58
|
+
"""A signal to create. The "type" decides the target field.
|
|
59
|
+
|
|
60
|
+
"personPosts" takes "person_url", "companyPosts" takes "company_url", "postSearch" takes
|
|
61
|
+
"term" (a phrase or a list of up to three) and an optional "filter", "postEngagement" takes
|
|
62
|
+
"post_url" or "my_posts=True", "listAlerts" takes "list_id" (the id of one of the account's
|
|
63
|
+
own Sales Navigator lists, as nv_retrieve_lists returns it), and "network" and
|
|
64
|
+
"profileViewers" take none. "label" is your own identifier, up to 64 characters, returned
|
|
65
|
+
with the signal and every event it produces.
|
|
66
|
+
"""
|
|
67
|
+
|
|
68
|
+
type: SignalType
|
|
69
|
+
label: str | None = Field(default=None, max_length=64)
|
|
70
|
+
person_url: str | None = None
|
|
71
|
+
company_url: str | None = None
|
|
72
|
+
post_url: str | None = None
|
|
73
|
+
my_posts: Literal[True] | None = None
|
|
74
|
+
term: str | list[str] | None = None
|
|
75
|
+
filter: SignalPostSearchFilter | None = None
|
|
76
|
+
list_id: str | None = Field(default=None, pattern=r"^[1-9]\d*$")
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
class GetSignalsParams(LinkedApiModel):
|
|
80
|
+
type: SignalType | None = None
|
|
81
|
+
status: SignalStatus | None = None
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
class SignalIdParams(LinkedApiModel):
|
|
85
|
+
signal_id: str
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
class SignalPollRequest(LinkedApiModel):
|
|
89
|
+
"""Pass "since" as the "detected_at" of the newest event you have; without it every
|
|
90
|
+
retained event is returned."""
|
|
91
|
+
|
|
92
|
+
since: str | None = None
|
|
93
|
+
signal_id: str | None = None
|
|
94
|
+
signal_type: SignalType | None = None
|
|
95
|
+
event_type: SignalEventType | None = None
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
class Signal(LinkedApiModel):
|
|
99
|
+
id: str | None = None
|
|
100
|
+
type: SignalType | str | None = None
|
|
101
|
+
label: str | None = None
|
|
102
|
+
status: SignalStatus | str | None = None
|
|
103
|
+
# Why Linked API stopped the signal; None unless status is "stopped".
|
|
104
|
+
stopped_reason: SignalStoppedReason | str | None = None
|
|
105
|
+
created_at: str | None = None
|
|
106
|
+
baseline_at: str | None = None
|
|
107
|
+
last_checked_at: str | None = None
|
|
108
|
+
next_check_at: str | None = None
|
|
109
|
+
person_url: str | None = None
|
|
110
|
+
company_url: str | None = None
|
|
111
|
+
post_url: str | None = None
|
|
112
|
+
my_posts: bool | None = None
|
|
113
|
+
term: str | list[str] | None = None
|
|
114
|
+
filter: dict[str, Any] | None = None
|
|
115
|
+
list_id: str | None = None
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
class SignalComment(PostComment):
|
|
119
|
+
parent_comment_urn: str | None = None
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
class SignalReaction(LinkedApiModel):
|
|
123
|
+
actor: PostAuthor | None = None
|
|
124
|
+
type: ReactionType | str | None = None
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
class SignalEvent(LinkedApiModel):
|
|
128
|
+
"""One event a signal detected. Which subject fields are set depends on "type": "post" for
|
|
129
|
+
postPublished and postFound, "post_url" with "comment" or "reaction", "viewer" for
|
|
130
|
+
profileViewed, "person_urn" with "person_url" for the connection events, and "alert" with
|
|
131
|
+
"subject_urn" and "subject_hashed_url" for alertPublished. "alert" is the alert exactly as
|
|
132
|
+
nv_retrieve_alerts returns it; "subject_urn" ("urn:li:member:<id>" or
|
|
133
|
+
"urn:li:organization:<id>") and "subject_hashed_url" are in the forms nv_retrieve_list_leads
|
|
134
|
+
and nv_retrieve_list_accounts return."""
|
|
135
|
+
|
|
136
|
+
id: str | None = None
|
|
137
|
+
signal_id: str | None = None
|
|
138
|
+
signal_type: SignalType | str | None = None
|
|
139
|
+
label: str | None = None
|
|
140
|
+
type: SignalEventType | str | None = None
|
|
141
|
+
# When Linked API recorded the event, not when it happened on LinkedIn.
|
|
142
|
+
detected_at: str | None = None
|
|
143
|
+
post: SearchPostResult | None = None
|
|
144
|
+
post_url: str | None = None
|
|
145
|
+
comment: SignalComment | None = None
|
|
146
|
+
reaction: SignalReaction | None = None
|
|
147
|
+
viewer: ProfileViewer | None = None
|
|
148
|
+
person_urn: str | None = None
|
|
149
|
+
person_url: str | None = None
|
|
150
|
+
alert: NvAlert | None = None
|
|
151
|
+
subject_urn: str | None = None
|
|
152
|
+
subject_hashed_url: str | None = None
|
|
@@ -6,6 +6,7 @@ from pydantic import SerializerFunctionWrapHandler, model_serializer
|
|
|
6
6
|
|
|
7
7
|
from linkedapi.types.base import LinkedApiModel
|
|
8
8
|
from linkedapi.types.message import InboxType, MessageSender
|
|
9
|
+
from linkedapi.types.signals import SignalEvent
|
|
9
10
|
|
|
10
11
|
WebhookPayloadMode = Literal["thin", "fat"]
|
|
11
12
|
WebhookEventType = Literal[
|
|
@@ -21,6 +22,15 @@ WebhookEventType = Literal[
|
|
|
21
22
|
"network.connectionAccepted",
|
|
22
23
|
"network.connectionAdded",
|
|
23
24
|
"network.connectionRequestReceived",
|
|
25
|
+
"signal.postPublished",
|
|
26
|
+
"signal.postFound",
|
|
27
|
+
"signal.commentAdded",
|
|
28
|
+
"signal.reactionAdded",
|
|
29
|
+
"signal.profileViewed",
|
|
30
|
+
"signal.connectionAccepted",
|
|
31
|
+
"signal.connectionAdded",
|
|
32
|
+
"signal.connectionRequestReceived",
|
|
33
|
+
"signal.alertPublished",
|
|
24
34
|
"webhook.test",
|
|
25
35
|
]
|
|
26
36
|
WebhookEventSelector = Literal[
|
|
@@ -36,10 +46,20 @@ WebhookEventSelector = Literal[
|
|
|
36
46
|
"network.connectionAccepted",
|
|
37
47
|
"network.connectionAdded",
|
|
38
48
|
"network.connectionRequestReceived",
|
|
49
|
+
"signal.postPublished",
|
|
50
|
+
"signal.postFound",
|
|
51
|
+
"signal.commentAdded",
|
|
52
|
+
"signal.reactionAdded",
|
|
53
|
+
"signal.profileViewed",
|
|
54
|
+
"signal.connectionAccepted",
|
|
55
|
+
"signal.connectionAdded",
|
|
56
|
+
"signal.connectionRequestReceived",
|
|
57
|
+
"signal.alertPublished",
|
|
39
58
|
"workflow.*",
|
|
40
59
|
"account.*",
|
|
41
60
|
"inbox.*",
|
|
42
61
|
"network.*",
|
|
62
|
+
"signal.*",
|
|
43
63
|
]
|
|
44
64
|
WebhookDeliveryStatus = Literal["pending", "delivering", "success", "failed"]
|
|
45
65
|
WorkflowWebhookStatus = Literal["pending", "running", "completed", "failed"]
|
|
@@ -222,6 +242,32 @@ class NetworkWebhookEvent(LinkedApiModel):
|
|
|
222
242
|
data: NetworkWebhookEventData
|
|
223
243
|
|
|
224
244
|
|
|
245
|
+
class SignalWebhookEventData(SignalEvent):
|
|
246
|
+
account_id: str | None = None
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
class SignalWebhookEvent(LinkedApiModel):
|
|
250
|
+
"""A signal event: "data" is the event exactly as poll_signals returns it, plus account_id."""
|
|
251
|
+
|
|
252
|
+
id: str
|
|
253
|
+
type: (
|
|
254
|
+
Literal[
|
|
255
|
+
"signal.postPublished",
|
|
256
|
+
"signal.postFound",
|
|
257
|
+
"signal.commentAdded",
|
|
258
|
+
"signal.reactionAdded",
|
|
259
|
+
"signal.profileViewed",
|
|
260
|
+
"signal.connectionAccepted",
|
|
261
|
+
"signal.connectionAdded",
|
|
262
|
+
"signal.connectionRequestReceived",
|
|
263
|
+
"signal.alertPublished",
|
|
264
|
+
]
|
|
265
|
+
| str
|
|
266
|
+
)
|
|
267
|
+
created_at: str | None = None
|
|
268
|
+
data: SignalWebhookEventData
|
|
269
|
+
|
|
270
|
+
|
|
225
271
|
class WebhookTestEventData(LinkedApiModel):
|
|
226
272
|
message: str | None = None
|
|
227
273
|
|
|
@@ -245,6 +291,7 @@ WebhookEvent = (
|
|
|
245
291
|
| AccountWebhookEvent
|
|
246
292
|
| MessageWebhookEvent
|
|
247
293
|
| NetworkWebhookEvent
|
|
294
|
+
| SignalWebhookEvent
|
|
248
295
|
| WebhookTestEvent
|
|
249
296
|
| UnknownWebhookEvent
|
|
250
297
|
)
|
|
@@ -7,6 +7,7 @@ from linkedapi.types.webhooks import (
|
|
|
7
7
|
AccountWebhookEvent,
|
|
8
8
|
MessageWebhookEvent,
|
|
9
9
|
NetworkWebhookEvent,
|
|
10
|
+
SignalWebhookEvent,
|
|
10
11
|
UnknownWebhookEvent,
|
|
11
12
|
WebhookEvent,
|
|
12
13
|
WebhookEventType,
|
|
@@ -53,6 +54,8 @@ def parse_webhook_event(raw_body: str | bytes) -> WebhookEvent:
|
|
|
53
54
|
return MessageWebhookEvent.model_validate(parsed)
|
|
54
55
|
if event_type.startswith("network."):
|
|
55
56
|
return NetworkWebhookEvent.model_validate(parsed)
|
|
57
|
+
if event_type.startswith("signal."):
|
|
58
|
+
return SignalWebhookEvent.model_validate(parsed)
|
|
56
59
|
if event_type == "webhook.test":
|
|
57
60
|
return WebhookTestEvent.model_validate(parsed)
|
|
58
61
|
|
|
@@ -39,6 +39,9 @@ def test_error_type_sets_match_node_contract() -> None:
|
|
|
39
39
|
"sessionNotFound",
|
|
40
40
|
"noAvailableSeats",
|
|
41
41
|
"dailyConnectionAttemptsExceeded",
|
|
42
|
+
"signalLimitReached",
|
|
43
|
+
"signalNotFound",
|
|
44
|
+
"signalStopped",
|
|
42
45
|
)
|
|
43
46
|
assert LINKED_API_ACTION_ERROR_TYPES == (
|
|
44
47
|
"personNotFound",
|
|
@@ -58,6 +58,13 @@ RESPONSE_VOCABULARIES = [
|
|
|
58
58
|
("SearchPostActor", "type", "person"),
|
|
59
59
|
("SearchPostResult", "type", "original"),
|
|
60
60
|
("SetSeatsResult", "status", "complete"),
|
|
61
|
+
("Signal", "type", "personPosts"),
|
|
62
|
+
("Signal", "status", "active"),
|
|
63
|
+
("Signal", "stopped_reason", "targetNotFound"),
|
|
64
|
+
("SignalEvent", "type", "postPublished"),
|
|
65
|
+
("SignalEvent", "signal_type", "network"),
|
|
66
|
+
("SignalReaction", "type", "like"),
|
|
67
|
+
("SignalWebhookEvent", "type", "signal.postPublished"),
|
|
61
68
|
("SubscriptionSeat", "seat_type", "core"),
|
|
62
69
|
("SubscriptionSeat", "billing_period", "month"),
|
|
63
70
|
("SubscriptionStatus", "status", "active"),
|
|
@@ -116,6 +123,14 @@ REQUEST_VOCABULARIES = [
|
|
|
116
123
|
("SetWebhookParams", "payload_mode", "thin", False),
|
|
117
124
|
("SetWebhookParams", "events", "workflow.created", True),
|
|
118
125
|
("SetWebhookPayloadModeParams", "payload_mode", "thin", False),
|
|
126
|
+
("CreateSignalParams", "type", "personPosts", False),
|
|
127
|
+
("GetSignalsParams", "type", "network", False),
|
|
128
|
+
("GetSignalsParams", "status", "active", False),
|
|
129
|
+
("SignalPollRequest", "signal_type", "network", False),
|
|
130
|
+
("SignalPollRequest", "event_type", "postPublished", False),
|
|
131
|
+
("SignalPostSearchFilter", "content_type", "videos", False),
|
|
132
|
+
("SignalPostSearchFilter", "posted_by", "me", True),
|
|
133
|
+
("SetWebhookParams", "events", "signal.*", True),
|
|
119
134
|
("StCompanyEmployeesFilter", "connection_degrees", "1st", True),
|
|
120
135
|
]
|
|
121
136
|
|