bereach 0.1.1
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.
- package/FUNCTIONS.md +90 -0
- package/README.md +530 -0
- package/RUNTIMES.md +48 -0
- package/esm/core.d.ts +10 -0
- package/esm/core.d.ts.map +1 -0
- package/esm/core.js +13 -0
- package/esm/core.js.map +1 -0
- package/esm/funcs/campaigns-filter.d.ts +20 -0
- package/esm/funcs/campaigns-filter.d.ts.map +1 -0
- package/esm/funcs/campaigns-filter.js +106 -0
- package/esm/funcs/campaigns-filter.js.map +1 -0
- package/esm/funcs/campaigns-get-stats.d.ts +18 -0
- package/esm/funcs/campaigns-get-stats.d.ts.map +1 -0
- package/esm/funcs/campaigns-get-stats.js +101 -0
- package/esm/funcs/campaigns-get-stats.js.map +1 -0
- package/esm/funcs/campaigns-get-status.d.ts +18 -0
- package/esm/funcs/campaigns-get-status.d.ts.map +1 -0
- package/esm/funcs/campaigns-get-status.js +101 -0
- package/esm/funcs/campaigns-get-status.js.map +1 -0
- package/esm/funcs/campaigns-sync-actions.d.ts +18 -0
- package/esm/funcs/campaigns-sync-actions.d.ts.map +1 -0
- package/esm/funcs/campaigns-sync-actions.js +101 -0
- package/esm/funcs/campaigns-sync-actions.js.map +1 -0
- package/esm/funcs/linkedin-actions-accept-invitation.d.ts +18 -0
- package/esm/funcs/linkedin-actions-accept-invitation.d.ts.map +1 -0
- package/esm/funcs/linkedin-actions-accept-invitation.js +95 -0
- package/esm/funcs/linkedin-actions-accept-invitation.js.map +1 -0
- package/esm/funcs/linkedin-actions-connect-profile.d.ts +18 -0
- package/esm/funcs/linkedin-actions-connect-profile.d.ts.map +1 -0
- package/esm/funcs/linkedin-actions-connect-profile.js +95 -0
- package/esm/funcs/linkedin-actions-connect-profile.js.map +1 -0
- package/esm/funcs/linkedin-actions-like-comment.d.ts +18 -0
- package/esm/funcs/linkedin-actions-like-comment.d.ts.map +1 -0
- package/esm/funcs/linkedin-actions-like-comment.js +95 -0
- package/esm/funcs/linkedin-actions-like-comment.js.map +1 -0
- package/esm/funcs/linkedin-actions-list-invitations.d.ts +18 -0
- package/esm/funcs/linkedin-actions-list-invitations.d.ts.map +1 -0
- package/esm/funcs/linkedin-actions-list-invitations.js +97 -0
- package/esm/funcs/linkedin-actions-list-invitations.js.map +1 -0
- package/esm/funcs/linkedin-actions-publish-post.d.ts +18 -0
- package/esm/funcs/linkedin-actions-publish-post.d.ts.map +1 -0
- package/esm/funcs/linkedin-actions-publish-post.js +95 -0
- package/esm/funcs/linkedin-actions-publish-post.js.map +1 -0
- package/esm/funcs/linkedin-actions-reply-to-comment.d.ts +18 -0
- package/esm/funcs/linkedin-actions-reply-to-comment.d.ts.map +1 -0
- package/esm/funcs/linkedin-actions-reply-to-comment.js +95 -0
- package/esm/funcs/linkedin-actions-reply-to-comment.js.map +1 -0
- package/esm/funcs/linkedin-actions-send-message.d.ts +18 -0
- package/esm/funcs/linkedin-actions-send-message.d.ts.map +1 -0
- package/esm/funcs/linkedin-actions-send-message.js +95 -0
- package/esm/funcs/linkedin-actions-send-message.js.map +1 -0
- package/esm/funcs/linkedin-chat-find-conversation.d.ts +25 -0
- package/esm/funcs/linkedin-chat-find-conversation.d.ts.map +1 -0
- package/esm/funcs/linkedin-chat-find-conversation.js +102 -0
- package/esm/funcs/linkedin-chat-find-conversation.js.map +1 -0
- package/esm/funcs/linkedin-chat-get-messages.d.ts +22 -0
- package/esm/funcs/linkedin-chat-get-messages.d.ts.map +1 -0
- package/esm/funcs/linkedin-chat-get-messages.js +99 -0
- package/esm/funcs/linkedin-chat-get-messages.js.map +1 -0
- package/esm/funcs/linkedin-chat-list-conversations.d.ts +18 -0
- package/esm/funcs/linkedin-chat-list-conversations.d.ts.map +1 -0
- package/esm/funcs/linkedin-chat-list-conversations.js +95 -0
- package/esm/funcs/linkedin-chat-list-conversations.js.map +1 -0
- package/esm/funcs/linkedin-chat-search-conversations.d.ts +18 -0
- package/esm/funcs/linkedin-chat-search-conversations.d.ts.map +1 -0
- package/esm/funcs/linkedin-chat-search-conversations.js +95 -0
- package/esm/funcs/linkedin-chat-search-conversations.js.map +1 -0
- package/esm/funcs/linkedin-scrapers-collect-comment-replies.d.ts +18 -0
- package/esm/funcs/linkedin-scrapers-collect-comment-replies.d.ts.map +1 -0
- package/esm/funcs/linkedin-scrapers-collect-comment-replies.js +95 -0
- package/esm/funcs/linkedin-scrapers-collect-comment-replies.js.map +1 -0
- package/esm/funcs/linkedin-scrapers-collect-comments.d.ts +18 -0
- package/esm/funcs/linkedin-scrapers-collect-comments.d.ts.map +1 -0
- package/esm/funcs/linkedin-scrapers-collect-comments.js +95 -0
- package/esm/funcs/linkedin-scrapers-collect-comments.js.map +1 -0
- package/esm/funcs/linkedin-scrapers-collect-likes.d.ts +18 -0
- package/esm/funcs/linkedin-scrapers-collect-likes.d.ts.map +1 -0
- package/esm/funcs/linkedin-scrapers-collect-likes.js +95 -0
- package/esm/funcs/linkedin-scrapers-collect-likes.js.map +1 -0
- package/esm/funcs/linkedin-scrapers-collect-posts.d.ts +18 -0
- package/esm/funcs/linkedin-scrapers-collect-posts.d.ts.map +1 -0
- package/esm/funcs/linkedin-scrapers-collect-posts.js +95 -0
- package/esm/funcs/linkedin-scrapers-collect-posts.js.map +1 -0
- package/esm/funcs/linkedin-scrapers-visit-company.d.ts +18 -0
- package/esm/funcs/linkedin-scrapers-visit-company.d.ts.map +1 -0
- package/esm/funcs/linkedin-scrapers-visit-company.js +95 -0
- package/esm/funcs/linkedin-scrapers-visit-company.js.map +1 -0
- package/esm/funcs/linkedin-scrapers-visit-profile.d.ts +18 -0
- package/esm/funcs/linkedin-scrapers-visit-profile.d.ts.map +1 -0
- package/esm/funcs/linkedin-scrapers-visit-profile.js +95 -0
- package/esm/funcs/linkedin-scrapers-visit-profile.js.map +1 -0
- package/esm/funcs/linkedin-search-resolve-parameters.d.ts +47 -0
- package/esm/funcs/linkedin-search-resolve-parameters.d.ts.map +1 -0
- package/esm/funcs/linkedin-search-resolve-parameters.js +124 -0
- package/esm/funcs/linkedin-search-resolve-parameters.js.map +1 -0
- package/esm/funcs/linkedin-search-search-by-url.d.ts +69 -0
- package/esm/funcs/linkedin-search-search-by-url.d.ts.map +1 -0
- package/esm/funcs/linkedin-search-search-by-url.js +146 -0
- package/esm/funcs/linkedin-search-search-by-url.js.map +1 -0
- package/esm/funcs/linkedin-search-search-companies.d.ts +75 -0
- package/esm/funcs/linkedin-search-search-companies.d.ts.map +1 -0
- package/esm/funcs/linkedin-search-search-companies.js +152 -0
- package/esm/funcs/linkedin-search-search-companies.js.map +1 -0
- package/esm/funcs/linkedin-search-search-jobs.d.ts +96 -0
- package/esm/funcs/linkedin-search-search-jobs.d.ts.map +1 -0
- package/esm/funcs/linkedin-search-search-jobs.js +173 -0
- package/esm/funcs/linkedin-search-search-jobs.js.map +1 -0
- package/esm/funcs/linkedin-search-search-people.d.ts +83 -0
- package/esm/funcs/linkedin-search-search-people.d.ts.map +1 -0
- package/esm/funcs/linkedin-search-search-people.js +160 -0
- package/esm/funcs/linkedin-search-search-people.js.map +1 -0
- package/esm/funcs/linkedin-search-search-posts.d.ts +71 -0
- package/esm/funcs/linkedin-search-search-posts.d.ts.map +1 -0
- package/esm/funcs/linkedin-search-search-posts.js +148 -0
- package/esm/funcs/linkedin-search-search-posts.js.map +1 -0
- package/esm/funcs/linkedin-search-unified-search.d.ts +55 -0
- package/esm/funcs/linkedin-search-unified-search.d.ts.map +1 -0
- package/esm/funcs/linkedin-search-unified-search.js +132 -0
- package/esm/funcs/linkedin-search-unified-search.js.map +1 -0
- package/esm/funcs/profile-get-credits.d.ts +18 -0
- package/esm/funcs/profile-get-credits.d.ts.map +1 -0
- package/esm/funcs/profile-get-credits.js +84 -0
- package/esm/funcs/profile-get-credits.js.map +1 -0
- package/esm/funcs/profile-get-followers.d.ts +18 -0
- package/esm/funcs/profile-get-followers.d.ts.map +1 -0
- package/esm/funcs/profile-get-followers.js +97 -0
- package/esm/funcs/profile-get-followers.js.map +1 -0
- package/esm/funcs/profile-get-limits.d.ts +18 -0
- package/esm/funcs/profile-get-limits.d.ts.map +1 -0
- package/esm/funcs/profile-get-limits.js +84 -0
- package/esm/funcs/profile-get-limits.js.map +1 -0
- package/esm/funcs/profile-get-linked-in-profile.d.ts +18 -0
- package/esm/funcs/profile-get-linked-in-profile.d.ts.map +1 -0
- package/esm/funcs/profile-get-linked-in-profile.js +84 -0
- package/esm/funcs/profile-get-linked-in-profile.js.map +1 -0
- package/esm/funcs/profile-get-posts.d.ts +18 -0
- package/esm/funcs/profile-get-posts.d.ts.map +1 -0
- package/esm/funcs/profile-get-posts.js +97 -0
- package/esm/funcs/profile-get-posts.js.map +1 -0
- package/esm/funcs/profile-refresh.d.ts +18 -0
- package/esm/funcs/profile-refresh.d.ts.map +1 -0
- package/esm/funcs/profile-refresh.js +84 -0
- package/esm/funcs/profile-refresh.js.map +1 -0
- package/esm/hooks/hooks.d.ts +25 -0
- package/esm/hooks/hooks.d.ts.map +1 -0
- package/esm/hooks/hooks.js +82 -0
- package/esm/hooks/hooks.js.map +1 -0
- package/esm/hooks/index.d.ts +3 -0
- package/esm/hooks/index.d.ts.map +1 -0
- package/esm/hooks/index.js +6 -0
- package/esm/hooks/index.js.map +1 -0
- package/esm/hooks/registration.d.ts +3 -0
- package/esm/hooks/registration.d.ts.map +1 -0
- package/esm/hooks/registration.js +12 -0
- package/esm/hooks/registration.js.map +1 -0
- package/esm/hooks/types.d.ts +76 -0
- package/esm/hooks/types.d.ts.map +1 -0
- package/esm/hooks/types.js +5 -0
- package/esm/hooks/types.js.map +1 -0
- package/esm/index.d.ts +6 -0
- package/esm/index.d.ts.map +1 -0
- package/esm/index.js +8 -0
- package/esm/index.js.map +1 -0
- package/esm/lib/base64.d.ts +10 -0
- package/esm/lib/base64.d.ts.map +1 -0
- package/esm/lib/base64.js +31 -0
- package/esm/lib/base64.js.map +1 -0
- package/esm/lib/config.d.ts +38 -0
- package/esm/lib/config.d.ts.map +1 -0
- package/esm/lib/config.js +34 -0
- package/esm/lib/config.js.map +1 -0
- package/esm/lib/dlv.d.ts +14 -0
- package/esm/lib/dlv.d.ts.map +1 -0
- package/esm/lib/dlv.js +46 -0
- package/esm/lib/dlv.js.map +1 -0
- package/esm/lib/encodings.d.ts +53 -0
- package/esm/lib/encodings.d.ts.map +1 -0
- package/esm/lib/encodings.js +370 -0
- package/esm/lib/encodings.js.map +1 -0
- package/esm/lib/env.d.ts +15 -0
- package/esm/lib/env.d.ts.map +1 -0
- package/esm/lib/env.js +44 -0
- package/esm/lib/env.js.map +1 -0
- package/esm/lib/files.d.ts +13 -0
- package/esm/lib/files.d.ts.map +1 -0
- package/esm/lib/files.js +73 -0
- package/esm/lib/files.js.map +1 -0
- package/esm/lib/http.d.ts +67 -0
- package/esm/lib/http.d.ts.map +1 -0
- package/esm/lib/http.js +209 -0
- package/esm/lib/http.js.map +1 -0
- package/esm/lib/is-plain-object.d.ts +2 -0
- package/esm/lib/is-plain-object.d.ts.map +1 -0
- package/esm/lib/is-plain-object.js +38 -0
- package/esm/lib/is-plain-object.js.map +1 -0
- package/esm/lib/logger.d.ts +6 -0
- package/esm/lib/logger.d.ts.map +1 -0
- package/esm/lib/logger.js +5 -0
- package/esm/lib/logger.js.map +1 -0
- package/esm/lib/matchers.d.ts +59 -0
- package/esm/lib/matchers.d.ts.map +1 -0
- package/esm/lib/matchers.js +202 -0
- package/esm/lib/matchers.js.map +1 -0
- package/esm/lib/primitives.d.ts +26 -0
- package/esm/lib/primitives.d.ts.map +1 -0
- package/esm/lib/primitives.js +103 -0
- package/esm/lib/primitives.js.map +1 -0
- package/esm/lib/retries.d.ts +38 -0
- package/esm/lib/retries.d.ts.map +1 -0
- package/esm/lib/retries.js +150 -0
- package/esm/lib/retries.js.map +1 -0
- package/esm/lib/schemas.d.ts +21 -0
- package/esm/lib/schemas.d.ts.map +1 -0
- package/esm/lib/schemas.js +57 -0
- package/esm/lib/schemas.js.map +1 -0
- package/esm/lib/sdks.d.ts +63 -0
- package/esm/lib/sdks.d.ts.map +1 -0
- package/esm/lib/sdks.js +258 -0
- package/esm/lib/sdks.js.map +1 -0
- package/esm/lib/security.d.ts +83 -0
- package/esm/lib/security.d.ts.map +1 -0
- package/esm/lib/security.js +138 -0
- package/esm/lib/security.js.map +1 -0
- package/esm/lib/url.d.ts +5 -0
- package/esm/lib/url.d.ts.map +1 -0
- package/esm/lib/url.js +22 -0
- package/esm/lib/url.js.map +1 -0
- package/esm/models/errors/bereach-default-error.d.ts +10 -0
- package/esm/models/errors/bereach-default-error.d.ts.map +1 -0
- package/esm/models/errors/bereach-default-error.js +30 -0
- package/esm/models/errors/bereach-default-error.js.map +1 -0
- package/esm/models/errors/bereach-error.d.ts +19 -0
- package/esm/models/errors/bereach-error.d.ts.map +1 -0
- package/esm/models/errors/bereach-error.js +26 -0
- package/esm/models/errors/bereach-error.js.map +1 -0
- package/esm/models/errors/collect-linked-in-likes.d.ts +211 -0
- package/esm/models/errors/collect-linked-in-likes.d.ts.map +1 -0
- package/esm/models/errors/collect-linked-in-likes.js +306 -0
- package/esm/models/errors/collect-linked-in-likes.js.map +1 -0
- package/esm/models/errors/http-client-errors.d.ts +44 -0
- package/esm/models/errors/http-client-errors.d.ts.map +1 -0
- package/esm/models/errors/http-client-errors.js +56 -0
- package/esm/models/errors/http-client-errors.js.map +1 -0
- package/esm/models/errors/index.d.ts +7 -0
- package/esm/models/errors/index.d.ts.map +1 -0
- package/esm/models/errors/index.js +10 -0
- package/esm/models/errors/index.js.map +1 -0
- package/esm/models/errors/response-validation-error.d.ts +26 -0
- package/esm/models/errors/response-validation-error.d.ts.map +1 -0
- package/esm/models/errors/response-validation-error.js +37 -0
- package/esm/models/errors/response-validation-error.js.map +1 -0
- package/esm/models/errors/sdk-validation-error.d.ts +21 -0
- package/esm/models/errors/sdk-validation-error.d.ts.map +1 -0
- package/esm/models/errors/sdk-validation-error.js +52 -0
- package/esm/models/errors/sdk-validation-error.js.map +1 -0
- package/esm/models/index.d.ts +2 -0
- package/esm/models/index.d.ts.map +1 -0
- package/esm/models/index.js +5 -0
- package/esm/models/index.js.map +1 -0
- package/esm/models/operations/get-campaign-stats-response.d.ts +1627 -0
- package/esm/models/operations/get-campaign-stats-response.d.ts.map +1 -0
- package/esm/models/operations/get-campaign-stats-response.js +1002 -0
- package/esm/models/operations/get-campaign-stats-response.js.map +1 -0
- package/esm/models/operations/index.d.ts +3 -0
- package/esm/models/operations/index.d.ts.map +1 -0
- package/esm/models/operations/index.js +6 -0
- package/esm/models/operations/index.js.map +1 -0
- package/esm/models/operations/send-linked-in-message-response.d.ts +2350 -0
- package/esm/models/operations/send-linked-in-message-response.d.ts.map +1 -0
- package/esm/models/operations/send-linked-in-message-response.js +1585 -0
- package/esm/models/operations/send-linked-in-message-response.js.map +1 -0
- package/esm/models/security.d.ts +12 -0
- package/esm/models/security.d.ts.map +1 -0
- package/esm/models/security.js +12 -0
- package/esm/models/security.js.map +1 -0
- package/esm/sdk/campaigns.d.ts +35 -0
- package/esm/sdk/campaigns.d.ts.map +1 -0
- package/esm/sdk/campaigns.js +50 -0
- package/esm/sdk/campaigns.js.map +1 -0
- package/esm/sdk/index.d.ts +2 -0
- package/esm/sdk/index.d.ts.map +1 -0
- package/esm/sdk/index.js +5 -0
- package/esm/sdk/index.js.map +1 -0
- package/esm/sdk/linkedin-actions.d.ts +54 -0
- package/esm/sdk/linkedin-actions.d.ts.map +1 -0
- package/esm/sdk/linkedin-actions.js +78 -0
- package/esm/sdk/linkedin-actions.js.map +1 -0
- package/esm/sdk/linkedin-chat.d.ts +44 -0
- package/esm/sdk/linkedin-chat.d.ts.map +1 -0
- package/esm/sdk/linkedin-chat.js +59 -0
- package/esm/sdk/linkedin-chat.js.map +1 -0
- package/esm/sdk/linkedin-scrapers.d.ts +47 -0
- package/esm/sdk/linkedin-scrapers.d.ts.map +1 -0
- package/esm/sdk/linkedin-scrapers.js +68 -0
- package/esm/sdk/linkedin-scrapers.js.map +1 -0
- package/esm/sdk/linkedin-search.d.ts +424 -0
- package/esm/sdk/linkedin-search.d.ts.map +1 -0
- package/esm/sdk/linkedin-search.js +448 -0
- package/esm/sdk/linkedin-search.js.map +1 -0
- package/esm/sdk/profile.d.ts +47 -0
- package/esm/sdk/profile.d.ts.map +1 -0
- package/esm/sdk/profile.js +68 -0
- package/esm/sdk/profile.js.map +1 -0
- package/esm/sdk/sdk.d.ts +22 -0
- package/esm/sdk/sdk.d.ts.map +1 -0
- package/esm/sdk/sdk.js +37 -0
- package/esm/sdk/sdk.js.map +1 -0
- package/esm/types/async.d.ts +23 -0
- package/esm/types/async.d.ts.map +1 -0
- package/esm/types/async.js +28 -0
- package/esm/types/async.js.map +1 -0
- package/esm/types/blobs.d.ts +4 -0
- package/esm/types/blobs.d.ts.map +1 -0
- package/esm/types/blobs.js +25 -0
- package/esm/types/blobs.js.map +1 -0
- package/esm/types/const-date-time.d.ts +3 -0
- package/esm/types/const-date-time.d.ts.map +1 -0
- package/esm/types/const-date-time.js +10 -0
- package/esm/types/const-date-time.js.map +1 -0
- package/esm/types/default-to-zero-value.d.ts +12 -0
- package/esm/types/default-to-zero-value.d.ts.map +1 -0
- package/esm/types/default-to-zero-value.js +31 -0
- package/esm/types/default-to-zero-value.js.map +1 -0
- package/esm/types/enums.d.ts +9 -0
- package/esm/types/enums.d.ts.map +1 -0
- package/esm/types/enums.js +27 -0
- package/esm/types/enums.js.map +1 -0
- package/esm/types/fp.d.ts +31 -0
- package/esm/types/fp.d.ts.map +1 -0
- package/esm/types/fp.js +31 -0
- package/esm/types/fp.js.map +1 -0
- package/esm/types/index.d.ts +10 -0
- package/esm/types/index.d.ts.map +1 -0
- package/esm/types/index.js +10 -0
- package/esm/types/index.js.map +1 -0
- package/esm/types/operations.d.ts +27 -0
- package/esm/types/operations.d.ts.map +1 -0
- package/esm/types/operations.js +77 -0
- package/esm/types/operations.js.map +1 -0
- package/esm/types/primitives.d.ts +11 -0
- package/esm/types/primitives.d.ts.map +1 -0
- package/esm/types/primitives.js +132 -0
- package/esm/types/primitives.js.map +1 -0
- package/esm/types/rfcdate.d.ts +21 -0
- package/esm/types/rfcdate.d.ts.map +1 -0
- package/esm/types/rfcdate.js +43 -0
- package/esm/types/rfcdate.js.map +1 -0
- package/esm/types/smart-union.d.ts +7 -0
- package/esm/types/smart-union.d.ts.map +1 -0
- package/esm/types/smart-union.js +117 -0
- package/esm/types/smart-union.js.map +1 -0
- package/esm/types/streams.d.ts +2 -0
- package/esm/types/streams.d.ts.map +1 -0
- package/esm/types/streams.js +15 -0
- package/esm/types/streams.js.map +1 -0
- package/esm/types/unrecognized.d.ts +16 -0
- package/esm/types/unrecognized.d.ts.map +1 -0
- package/esm/types/unrecognized.js +31 -0
- package/esm/types/unrecognized.js.map +1 -0
- package/examples/linkedinScrapersCollectLikes.example.ts +30 -0
- package/jsr.json +27 -0
- package/package.json +62 -0
- package/src/core.ts +13 -0
- package/src/funcs/campaigns-filter.ts +227 -0
- package/src/funcs/campaigns-get-stats.ts +222 -0
- package/src/funcs/campaigns-get-status.ts +222 -0
- package/src/funcs/campaigns-sync-actions.ts +222 -0
- package/src/funcs/linkedin-actions-accept-invitation.ts +215 -0
- package/src/funcs/linkedin-actions-connect-profile.ts +215 -0
- package/src/funcs/linkedin-actions-like-comment.ts +215 -0
- package/src/funcs/linkedin-actions-list-invitations.ts +220 -0
- package/src/funcs/linkedin-actions-publish-post.ts +215 -0
- package/src/funcs/linkedin-actions-reply-to-comment.ts +215 -0
- package/src/funcs/linkedin-actions-send-message.ts +215 -0
- package/src/funcs/linkedin-chat-find-conversation.ts +222 -0
- package/src/funcs/linkedin-chat-get-messages.ts +219 -0
- package/src/funcs/linkedin-chat-list-conversations.ts +215 -0
- package/src/funcs/linkedin-chat-search-conversations.ts +218 -0
- package/src/funcs/linkedin-scrapers-collect-comment-replies.ts +218 -0
- package/src/funcs/linkedin-scrapers-collect-comments.ts +215 -0
- package/src/funcs/linkedin-scrapers-collect-likes.ts +215 -0
- package/src/funcs/linkedin-scrapers-collect-posts.ts +215 -0
- package/src/funcs/linkedin-scrapers-visit-company.ts +215 -0
- package/src/funcs/linkedin-scrapers-visit-profile.ts +215 -0
- package/src/funcs/linkedin-search-resolve-parameters.ts +250 -0
- package/src/funcs/linkedin-search-search-by-url.ts +266 -0
- package/src/funcs/linkedin-search-search-companies.ts +272 -0
- package/src/funcs/linkedin-search-search-jobs.ts +293 -0
- package/src/funcs/linkedin-search-search-people.ts +280 -0
- package/src/funcs/linkedin-search-search-posts.ts +268 -0
- package/src/funcs/linkedin-search-unified-search.ts +251 -0
- package/src/funcs/profile-get-credits.ts +195 -0
- package/src/funcs/profile-get-followers.ts +220 -0
- package/src/funcs/profile-get-limits.ts +195 -0
- package/src/funcs/profile-get-linked-in-profile.ts +195 -0
- package/src/funcs/profile-get-posts.ts +220 -0
- package/src/funcs/profile-refresh.ts +195 -0
- package/src/hooks/hooks.ts +132 -0
- package/src/hooks/index.ts +6 -0
- package/src/hooks/registration.ts +14 -0
- package/src/hooks/types.ts +107 -0
- package/src/index.ts +9 -0
- package/src/lib/base64.ts +39 -0
- package/src/lib/config.ts +67 -0
- package/src/lib/dlv.ts +53 -0
- package/src/lib/encodings.ts +501 -0
- package/src/lib/env.ts +57 -0
- package/src/lib/files.ts +82 -0
- package/src/lib/http.ts +323 -0
- package/src/lib/is-plain-object.ts +43 -0
- package/src/lib/logger.ts +9 -0
- package/src/lib/matchers.ts +353 -0
- package/src/lib/primitives.ts +150 -0
- package/src/lib/retries.ts +218 -0
- package/src/lib/schemas.ts +94 -0
- package/src/lib/sdks.ts +406 -0
- package/src/lib/security.ts +263 -0
- package/src/lib/url.ts +33 -0
- package/src/models/errors/bereach-default-error.ts +40 -0
- package/src/models/errors/bereach-error.ts +35 -0
- package/src/models/errors/collect-linked-in-likes.ts +494 -0
- package/src/models/errors/http-client-errors.ts +62 -0
- package/src/models/errors/index.ts +10 -0
- package/src/models/errors/response-validation-error.ts +50 -0
- package/src/models/errors/sdk-validation-error.ts +54 -0
- package/src/models/index.ts +5 -0
- package/src/models/operations/get-campaign-stats-response.ts +3409 -0
- package/src/models/operations/index.ts +6 -0
- package/src/models/operations/send-linked-in-message-response.ts +4903 -0
- package/src/models/security.ts +26 -0
- package/src/sdk/campaigns.ts +83 -0
- package/src/sdk/index.ts +5 -0
- package/src/sdk/linkedin-actions.ts +135 -0
- package/src/sdk/linkedin-chat.ts +92 -0
- package/src/sdk/linkedin-scrapers.ts +117 -0
- package/src/sdk/linkedin-search.ts +505 -0
- package/src/sdk/profile.ts +109 -0
- package/src/sdk/sdk.ts +43 -0
- package/src/types/async.ts +68 -0
- package/src/types/blobs.ts +33 -0
- package/src/types/const-date-time.ts +15 -0
- package/src/types/default-to-zero-value.ts +33 -0
- package/src/types/enums.ts +45 -0
- package/src/types/fp.ts +50 -0
- package/src/types/index.ts +13 -0
- package/src/types/operations.ts +105 -0
- package/src/types/primitives.ts +168 -0
- package/src/types/rfcdate.ts +54 -0
- package/src/types/smart-union.ts +153 -0
- package/src/types/streams.ts +21 -0
- package/src/types/unrecognized.ts +35 -0
package/FUNCTIONS.md
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# Standalone Functions
|
|
2
|
+
|
|
3
|
+
> [!NOTE]
|
|
4
|
+
> This section is useful if you are using a bundler and targetting browsers and
|
|
5
|
+
> runtimes where the size of an application affects performance and load times.
|
|
6
|
+
|
|
7
|
+
Every method in this SDK is also available as a standalone function. This
|
|
8
|
+
alternative API is suitable when targetting the browser or serverless runtimes
|
|
9
|
+
and using a bundler to build your application since all unused functionality
|
|
10
|
+
will be tree-shaken away. This includes code for unused methods, Zod schemas,
|
|
11
|
+
encoding helpers and response handlers. The result is dramatically smaller
|
|
12
|
+
impact on the application's final bundle size which grows very slowly as you use
|
|
13
|
+
more and more functionality from this SDK.
|
|
14
|
+
|
|
15
|
+
Calling methods through the main SDK class remains a valid and generally more
|
|
16
|
+
more ergonomic option. Standalone functions represent an optimisation for a
|
|
17
|
+
specific category of applications.
|
|
18
|
+
|
|
19
|
+
## Example
|
|
20
|
+
|
|
21
|
+
```typescript
|
|
22
|
+
import { BereachCore } from "bereach/core.js";
|
|
23
|
+
import { linkedinScrapersCollectLikes } from "bereach/funcs/linkedin-scrapers-collect-likes.js";
|
|
24
|
+
|
|
25
|
+
// Use `BereachCore` for best tree-shaking performance.
|
|
26
|
+
// You can create one instance of it to use across an application.
|
|
27
|
+
const bereach = new BereachCore({
|
|
28
|
+
token: "BEREACH_API_KEY",
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
async function run() {
|
|
32
|
+
const res = await linkedinScrapersCollectLikes(bereach, {
|
|
33
|
+
postUrl: "https://www.linkedin.com/feed/update/urn:li:activity:1234567890123456789/",
|
|
34
|
+
start: 0,
|
|
35
|
+
});
|
|
36
|
+
if (res.ok) {
|
|
37
|
+
const { value: result } = res;
|
|
38
|
+
console.log(result);
|
|
39
|
+
} else {
|
|
40
|
+
console.log("linkedinScrapersCollectLikes failed:", res.error);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
run();
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Result types
|
|
48
|
+
|
|
49
|
+
Standalone functions differ from SDK methods in that they return a
|
|
50
|
+
`Result<Value, Error>` type to capture _known errors_ and document them using
|
|
51
|
+
the type system. By avoiding throwing errors, application code maintains clear
|
|
52
|
+
control flow and error-handling become part of the regular flow of application
|
|
53
|
+
code.
|
|
54
|
+
|
|
55
|
+
> We use the term "known errors" because standalone functions, and JavaScript
|
|
56
|
+
> code in general, can still throw unexpected errors such as `TypeError`s,
|
|
57
|
+
> `RangeError`s and `DOMException`s. Exhaustively catching all errors may be
|
|
58
|
+
> something this SDK addresses in the future. Nevertheless, there is still a lot
|
|
59
|
+
> of benefit from capturing most errors and turning them into values.
|
|
60
|
+
|
|
61
|
+
The second reason for this style of programming is because these functions will
|
|
62
|
+
typically be used in front-end applications where exception throwing is
|
|
63
|
+
sometimes discouraged or considered unidiomatic. React and similar ecosystems
|
|
64
|
+
and libraries tend to promote this style of programming so that components
|
|
65
|
+
render useful content under all states (loading, success, error and so on).
|
|
66
|
+
|
|
67
|
+
The general pattern when calling standalone functions looks like this:
|
|
68
|
+
|
|
69
|
+
```typescript
|
|
70
|
+
import { Core } from "<sdk-package-name>";
|
|
71
|
+
import { fetchSomething } from "<sdk-package-name>/funcs/fetchSomething.js";
|
|
72
|
+
|
|
73
|
+
const client = new Core();
|
|
74
|
+
|
|
75
|
+
async function run() {
|
|
76
|
+
const result = await fetchSomething(client, { id: "123" });
|
|
77
|
+
if (!result.ok) {
|
|
78
|
+
// You can throw the error or handle it. It's your choice now.
|
|
79
|
+
throw result.error;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
console.log(result.value);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
run();
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Notably, `result.error` above will have an explicit type compared to a try-catch
|
|
89
|
+
variation where the error in the catch block can only be of type `unknown` (or
|
|
90
|
+
`any` depending on your TypeScript settings).
|
package/README.md
ADDED
|
@@ -0,0 +1,530 @@
|
|
|
1
|
+
# bereach
|
|
2
|
+
|
|
3
|
+
Developer-friendly & type-safe Typescript SDK specifically catered to leverage *bereach* API.
|
|
4
|
+
|
|
5
|
+
[](https://www.speakeasy.com/?utm_source=bereach&utm_campaign=typescript)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
<br /><br />
|
|
10
|
+
> [!IMPORTANT]
|
|
11
|
+
> This SDK is not yet ready for production use. To complete setup please follow the steps outlined in your [workspace](https://app.speakeasy.com/org/bereach/bereach). Delete this section before > publishing to a package manager.
|
|
12
|
+
|
|
13
|
+
<!-- Start Summary [summary] -->
|
|
14
|
+
## Summary
|
|
15
|
+
|
|
16
|
+
BeReach API: BeReach | Unofficial Linkedin API
|
|
17
|
+
<!-- End Summary [summary] -->
|
|
18
|
+
|
|
19
|
+
<!-- Start Table of Contents [toc] -->
|
|
20
|
+
## Table of Contents
|
|
21
|
+
<!-- $toc-max-depth=2 -->
|
|
22
|
+
* [bereach](#bereach)
|
|
23
|
+
* [SDK Installation](#sdk-installation)
|
|
24
|
+
* [Requirements](#requirements)
|
|
25
|
+
* [SDK Example Usage](#sdk-example-usage)
|
|
26
|
+
* [Authentication](#authentication)
|
|
27
|
+
* [Available Resources and Operations](#available-resources-and-operations)
|
|
28
|
+
* [Standalone functions](#standalone-functions)
|
|
29
|
+
* [Retries](#retries)
|
|
30
|
+
* [Error Handling](#error-handling)
|
|
31
|
+
* [Server Selection](#server-selection)
|
|
32
|
+
* [Custom HTTP Client](#custom-http-client)
|
|
33
|
+
* [Debugging](#debugging)
|
|
34
|
+
* [Development](#development)
|
|
35
|
+
* [Maturity](#maturity)
|
|
36
|
+
* [Contributions](#contributions)
|
|
37
|
+
|
|
38
|
+
<!-- End Table of Contents [toc] -->
|
|
39
|
+
|
|
40
|
+
<!-- Start SDK Installation [installation] -->
|
|
41
|
+
## SDK Installation
|
|
42
|
+
|
|
43
|
+
> [!TIP]
|
|
44
|
+
> To finish publishing your SDK to npm and others you must [run your first generation action](https://www.speakeasy.com/docs/github-setup#step-by-step-guide).
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
The SDK can be installed with either [npm](https://www.npmjs.com/), [pnpm](https://pnpm.io/), [bun](https://bun.sh/) or [yarn](https://classic.yarnpkg.com/en/) package managers.
|
|
48
|
+
|
|
49
|
+
### NPM
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
npm add <UNSET>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### PNPM
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
pnpm add <UNSET>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Bun
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
bun add <UNSET>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Yarn
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
yarn add <UNSET>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
> [!NOTE]
|
|
74
|
+
> This package is published as an ES Module (ESM) only. For applications using
|
|
75
|
+
> CommonJS, use `await import()` to import and use this package.
|
|
76
|
+
<!-- End SDK Installation [installation] -->
|
|
77
|
+
|
|
78
|
+
<!-- Start Requirements [requirements] -->
|
|
79
|
+
## Requirements
|
|
80
|
+
|
|
81
|
+
For supported JavaScript runtimes, please consult [RUNTIMES.md](RUNTIMES.md).
|
|
82
|
+
<!-- End Requirements [requirements] -->
|
|
83
|
+
|
|
84
|
+
<!-- Start SDK Example Usage [usage] -->
|
|
85
|
+
## SDK Example Usage
|
|
86
|
+
|
|
87
|
+
### Example
|
|
88
|
+
|
|
89
|
+
```typescript
|
|
90
|
+
import { Bereach } from "bereach";
|
|
91
|
+
|
|
92
|
+
const bereach = new Bereach({
|
|
93
|
+
token: "BEREACH_API_KEY",
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
async function run() {
|
|
97
|
+
const result = await bereach.linkedinScrapers.collectLikes({
|
|
98
|
+
postUrl:
|
|
99
|
+
"https://www.linkedin.com/feed/update/urn:li:activity:1234567890123456789/",
|
|
100
|
+
start: 0,
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
console.log(result);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
run();
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
<!-- End SDK Example Usage [usage] -->
|
|
110
|
+
|
|
111
|
+
<!-- Start Authentication [security] -->
|
|
112
|
+
## Authentication
|
|
113
|
+
|
|
114
|
+
### Per-Client Security Schemes
|
|
115
|
+
|
|
116
|
+
This SDK supports the following security scheme globally:
|
|
117
|
+
|
|
118
|
+
| Name | Type | Scheme | Environment Variable |
|
|
119
|
+
| ------- | ---- | ----------- | -------------------- |
|
|
120
|
+
| `token` | http | HTTP Bearer | `BEREACH_TOKEN` |
|
|
121
|
+
|
|
122
|
+
To authenticate with the API the `token` parameter must be set when initializing the SDK client instance. For example:
|
|
123
|
+
```typescript
|
|
124
|
+
import { Bereach } from "bereach";
|
|
125
|
+
|
|
126
|
+
const bereach = new Bereach({
|
|
127
|
+
token: "BEREACH_API_KEY",
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
async function run() {
|
|
131
|
+
const result = await bereach.linkedinScrapers.collectLikes({
|
|
132
|
+
postUrl:
|
|
133
|
+
"https://www.linkedin.com/feed/update/urn:li:activity:1234567890123456789/",
|
|
134
|
+
start: 0,
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
console.log(result);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
run();
|
|
141
|
+
|
|
142
|
+
```
|
|
143
|
+
<!-- End Authentication [security] -->
|
|
144
|
+
|
|
145
|
+
<!-- Start Available Resources and Operations [operations] -->
|
|
146
|
+
## Available Resources and Operations
|
|
147
|
+
|
|
148
|
+
<details open>
|
|
149
|
+
<summary>Available methods</summary>
|
|
150
|
+
|
|
151
|
+
### [Campaigns](docs/sdks/campaigns/README.md)
|
|
152
|
+
|
|
153
|
+
* [~~filter~~](docs/sdks/campaigns/README.md#filter) - Check if campaign actions are completed :warning: **Deprecated**
|
|
154
|
+
* [getStatus](docs/sdks/campaigns/README.md#getstatus) - Query per-profile action status within a campaign
|
|
155
|
+
* [syncActions](docs/sdks/campaigns/README.md#syncactions) - Mark actions as completed without performing them
|
|
156
|
+
* [getStats](docs/sdks/campaigns/README.md#getstats) - Get aggregate campaign statistics
|
|
157
|
+
|
|
158
|
+
### [LinkedinActions](docs/sdks/linkedinactions/README.md)
|
|
159
|
+
|
|
160
|
+
* [connectProfile](docs/sdks/linkedinactions/README.md#connectprofile) - Send LinkedIn connection request
|
|
161
|
+
* [listInvitations](docs/sdks/linkedinactions/README.md#listinvitations) - List received LinkedIn connection invitations
|
|
162
|
+
* [acceptInvitation](docs/sdks/linkedinactions/README.md#acceptinvitation) - Accept a LinkedIn connection invitation
|
|
163
|
+
* [sendMessage](docs/sdks/linkedinactions/README.md#sendmessage) - Send LinkedIn message
|
|
164
|
+
* [replyToComment](docs/sdks/linkedinactions/README.md#replytocomment) - Reply to a LinkedIn comment
|
|
165
|
+
* [likeComment](docs/sdks/linkedinactions/README.md#likecomment) - Like a LinkedIn comment
|
|
166
|
+
* [publishPost](docs/sdks/linkedinactions/README.md#publishpost) - Publish or schedule a LinkedIn post
|
|
167
|
+
|
|
168
|
+
### [LinkedinChat](docs/sdks/linkedinchat/README.md)
|
|
169
|
+
|
|
170
|
+
* [listConversations](docs/sdks/linkedinchat/README.md#listconversations) - List LinkedIn inbox conversations
|
|
171
|
+
* [searchConversations](docs/sdks/linkedinchat/README.md#searchconversations) - Search LinkedIn conversations
|
|
172
|
+
* [findConversation](docs/sdks/linkedinchat/README.md#findconversation) - Find a conversation with a specific person
|
|
173
|
+
* [getMessages](docs/sdks/linkedinchat/README.md#getmessages) - Read messages from a conversation
|
|
174
|
+
|
|
175
|
+
### [LinkedinScrapers](docs/sdks/linkedinscrapers/README.md)
|
|
176
|
+
|
|
177
|
+
* [collectLikes](docs/sdks/linkedinscrapers/README.md#collectlikes) - Scrape LinkedIn post likes
|
|
178
|
+
* [collectComments](docs/sdks/linkedinscrapers/README.md#collectcomments) - Scrape LinkedIn post comments
|
|
179
|
+
* [collectCommentReplies](docs/sdks/linkedinscrapers/README.md#collectcommentreplies) - Scrape replies to a LinkedIn comment
|
|
180
|
+
* [collectPosts](docs/sdks/linkedinscrapers/README.md#collectposts) - Scrape LinkedIn profile posts
|
|
181
|
+
* [visitProfile](docs/sdks/linkedinscrapers/README.md#visitprofile) - Visit LinkedIn profile and extract contact data
|
|
182
|
+
* [visitCompany](docs/sdks/linkedinscrapers/README.md#visitcompany) - Visit LinkedIn company page and extract profile data
|
|
183
|
+
|
|
184
|
+
### [LinkedinSearch](docs/sdks/linkedinsearch/README.md)
|
|
185
|
+
|
|
186
|
+
* [unifiedSearch](docs/sdks/linkedinsearch/README.md#unifiedsearch) - Unified LinkedIn Search — posts, people, companies, jobs
|
|
187
|
+
* [searchPosts](docs/sdks/linkedinsearch/README.md#searchposts) - Search LinkedIn Posts
|
|
188
|
+
* [searchPeople](docs/sdks/linkedinsearch/README.md#searchpeople) - Search LinkedIn People
|
|
189
|
+
* [searchCompanies](docs/sdks/linkedinsearch/README.md#searchcompanies) - Search LinkedIn Companies
|
|
190
|
+
* [searchJobs](docs/sdks/linkedinsearch/README.md#searchjobs) - Search LinkedIn Jobs
|
|
191
|
+
* [searchByUrl](docs/sdks/linkedinsearch/README.md#searchbyurl) - Search LinkedIn by URL
|
|
192
|
+
* [resolveParameters](docs/sdks/linkedinsearch/README.md#resolveparameters) - Resolve text to LinkedIn search parameter IDs (typeahead)
|
|
193
|
+
|
|
194
|
+
### [Profile](docs/sdks/profile/README.md)
|
|
195
|
+
|
|
196
|
+
* [getLinkedInProfile](docs/sdks/profile/README.md#getlinkedinprofile) - Get authenticated user's LinkedIn profile
|
|
197
|
+
* [refresh](docs/sdks/profile/README.md#refresh) - Refresh authenticated user's LinkedIn profile
|
|
198
|
+
* [getPosts](docs/sdks/profile/README.md#getposts) - Get authenticated user's LinkedIn posts
|
|
199
|
+
* [getFollowers](docs/sdks/profile/README.md#getfollowers) - Get authenticated user's LinkedIn followers
|
|
200
|
+
* [getLimits](docs/sdks/profile/README.md#getlimits) - Get current LinkedIn rate limit status
|
|
201
|
+
* [getCredits](docs/sdks/profile/README.md#getcredits) - Get current BeReach credit balance
|
|
202
|
+
|
|
203
|
+
</details>
|
|
204
|
+
<!-- End Available Resources and Operations [operations] -->
|
|
205
|
+
|
|
206
|
+
<!-- Start Standalone functions [standalone-funcs] -->
|
|
207
|
+
## Standalone functions
|
|
208
|
+
|
|
209
|
+
All the methods listed above are available as standalone functions. These
|
|
210
|
+
functions are ideal for use in applications running in the browser, serverless
|
|
211
|
+
runtimes or other environments where application bundle size is a primary
|
|
212
|
+
concern. When using a bundler to build your application, all unused
|
|
213
|
+
functionality will be either excluded from the final bundle or tree-shaken away.
|
|
214
|
+
|
|
215
|
+
To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).
|
|
216
|
+
|
|
217
|
+
<details>
|
|
218
|
+
|
|
219
|
+
<summary>Available standalone functions</summary>
|
|
220
|
+
|
|
221
|
+
- [`campaignsGetStats`](docs/sdks/campaigns/README.md#getstats) - Get aggregate campaign statistics
|
|
222
|
+
- [`campaignsGetStatus`](docs/sdks/campaigns/README.md#getstatus) - Query per-profile action status within a campaign
|
|
223
|
+
- [`campaignsSyncActions`](docs/sdks/campaigns/README.md#syncactions) - Mark actions as completed without performing them
|
|
224
|
+
- [`linkedinActionsAcceptInvitation`](docs/sdks/linkedinactions/README.md#acceptinvitation) - Accept a LinkedIn connection invitation
|
|
225
|
+
- [`linkedinActionsConnectProfile`](docs/sdks/linkedinactions/README.md#connectprofile) - Send LinkedIn connection request
|
|
226
|
+
- [`linkedinActionsLikeComment`](docs/sdks/linkedinactions/README.md#likecomment) - Like a LinkedIn comment
|
|
227
|
+
- [`linkedinActionsListInvitations`](docs/sdks/linkedinactions/README.md#listinvitations) - List received LinkedIn connection invitations
|
|
228
|
+
- [`linkedinActionsPublishPost`](docs/sdks/linkedinactions/README.md#publishpost) - Publish or schedule a LinkedIn post
|
|
229
|
+
- [`linkedinActionsReplyToComment`](docs/sdks/linkedinactions/README.md#replytocomment) - Reply to a LinkedIn comment
|
|
230
|
+
- [`linkedinActionsSendMessage`](docs/sdks/linkedinactions/README.md#sendmessage) - Send LinkedIn message
|
|
231
|
+
- [`linkedinChatFindConversation`](docs/sdks/linkedinchat/README.md#findconversation) - Find a conversation with a specific person
|
|
232
|
+
- [`linkedinChatGetMessages`](docs/sdks/linkedinchat/README.md#getmessages) - Read messages from a conversation
|
|
233
|
+
- [`linkedinChatListConversations`](docs/sdks/linkedinchat/README.md#listconversations) - List LinkedIn inbox conversations
|
|
234
|
+
- [`linkedinChatSearchConversations`](docs/sdks/linkedinchat/README.md#searchconversations) - Search LinkedIn conversations
|
|
235
|
+
- [`linkedinScrapersCollectCommentReplies`](docs/sdks/linkedinscrapers/README.md#collectcommentreplies) - Scrape replies to a LinkedIn comment
|
|
236
|
+
- [`linkedinScrapersCollectComments`](docs/sdks/linkedinscrapers/README.md#collectcomments) - Scrape LinkedIn post comments
|
|
237
|
+
- [`linkedinScrapersCollectLikes`](docs/sdks/linkedinscrapers/README.md#collectlikes) - Scrape LinkedIn post likes
|
|
238
|
+
- [`linkedinScrapersCollectPosts`](docs/sdks/linkedinscrapers/README.md#collectposts) - Scrape LinkedIn profile posts
|
|
239
|
+
- [`linkedinScrapersVisitCompany`](docs/sdks/linkedinscrapers/README.md#visitcompany) - Visit LinkedIn company page and extract profile data
|
|
240
|
+
- [`linkedinScrapersVisitProfile`](docs/sdks/linkedinscrapers/README.md#visitprofile) - Visit LinkedIn profile and extract contact data
|
|
241
|
+
- [`linkedinSearchResolveParameters`](docs/sdks/linkedinsearch/README.md#resolveparameters) - Resolve text to LinkedIn search parameter IDs (typeahead)
|
|
242
|
+
- [`linkedinSearchSearchByUrl`](docs/sdks/linkedinsearch/README.md#searchbyurl) - Search LinkedIn by URL
|
|
243
|
+
- [`linkedinSearchSearchCompanies`](docs/sdks/linkedinsearch/README.md#searchcompanies) - Search LinkedIn Companies
|
|
244
|
+
- [`linkedinSearchSearchJobs`](docs/sdks/linkedinsearch/README.md#searchjobs) - Search LinkedIn Jobs
|
|
245
|
+
- [`linkedinSearchSearchPeople`](docs/sdks/linkedinsearch/README.md#searchpeople) - Search LinkedIn People
|
|
246
|
+
- [`linkedinSearchSearchPosts`](docs/sdks/linkedinsearch/README.md#searchposts) - Search LinkedIn Posts
|
|
247
|
+
- [`linkedinSearchUnifiedSearch`](docs/sdks/linkedinsearch/README.md#unifiedsearch) - Unified LinkedIn Search — posts, people, companies, jobs
|
|
248
|
+
- [`profileGetCredits`](docs/sdks/profile/README.md#getcredits) - Get current BeReach credit balance
|
|
249
|
+
- [`profileGetFollowers`](docs/sdks/profile/README.md#getfollowers) - Get authenticated user's LinkedIn followers
|
|
250
|
+
- [`profileGetLimits`](docs/sdks/profile/README.md#getlimits) - Get current LinkedIn rate limit status
|
|
251
|
+
- [`profileGetLinkedInProfile`](docs/sdks/profile/README.md#getlinkedinprofile) - Get authenticated user's LinkedIn profile
|
|
252
|
+
- [`profileGetPosts`](docs/sdks/profile/README.md#getposts) - Get authenticated user's LinkedIn posts
|
|
253
|
+
- [`profileRefresh`](docs/sdks/profile/README.md#refresh) - Refresh authenticated user's LinkedIn profile
|
|
254
|
+
- ~~[`campaignsFilter`](docs/sdks/campaigns/README.md#filter)~~ - Check if campaign actions are completed :warning: **Deprecated**
|
|
255
|
+
|
|
256
|
+
</details>
|
|
257
|
+
<!-- End Standalone functions [standalone-funcs] -->
|
|
258
|
+
|
|
259
|
+
<!-- Start Retries [retries] -->
|
|
260
|
+
## Retries
|
|
261
|
+
|
|
262
|
+
Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.
|
|
263
|
+
|
|
264
|
+
To change the default retry strategy for a single API call, simply provide a retryConfig object to the call:
|
|
265
|
+
```typescript
|
|
266
|
+
import { Bereach } from "bereach";
|
|
267
|
+
|
|
268
|
+
const bereach = new Bereach({
|
|
269
|
+
token: "BEREACH_API_KEY",
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
async function run() {
|
|
273
|
+
const result = await bereach.linkedinScrapers.collectLikes({
|
|
274
|
+
postUrl:
|
|
275
|
+
"https://www.linkedin.com/feed/update/urn:li:activity:1234567890123456789/",
|
|
276
|
+
start: 0,
|
|
277
|
+
}, {
|
|
278
|
+
retries: {
|
|
279
|
+
strategy: "backoff",
|
|
280
|
+
backoff: {
|
|
281
|
+
initialInterval: 1,
|
|
282
|
+
maxInterval: 50,
|
|
283
|
+
exponent: 1.1,
|
|
284
|
+
maxElapsedTime: 100,
|
|
285
|
+
},
|
|
286
|
+
retryConnectionErrors: false,
|
|
287
|
+
},
|
|
288
|
+
});
|
|
289
|
+
|
|
290
|
+
console.log(result);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
run();
|
|
294
|
+
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
If you'd like to override the default retry strategy for all operations that support retries, you can provide a retryConfig at SDK initialization:
|
|
298
|
+
```typescript
|
|
299
|
+
import { Bereach } from "bereach";
|
|
300
|
+
|
|
301
|
+
const bereach = new Bereach({
|
|
302
|
+
retryConfig: {
|
|
303
|
+
strategy: "backoff",
|
|
304
|
+
backoff: {
|
|
305
|
+
initialInterval: 1,
|
|
306
|
+
maxInterval: 50,
|
|
307
|
+
exponent: 1.1,
|
|
308
|
+
maxElapsedTime: 100,
|
|
309
|
+
},
|
|
310
|
+
retryConnectionErrors: false,
|
|
311
|
+
},
|
|
312
|
+
token: "BEREACH_API_KEY",
|
|
313
|
+
});
|
|
314
|
+
|
|
315
|
+
async function run() {
|
|
316
|
+
const result = await bereach.linkedinScrapers.collectLikes({
|
|
317
|
+
postUrl:
|
|
318
|
+
"https://www.linkedin.com/feed/update/urn:li:activity:1234567890123456789/",
|
|
319
|
+
start: 0,
|
|
320
|
+
});
|
|
321
|
+
|
|
322
|
+
console.log(result);
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
run();
|
|
326
|
+
|
|
327
|
+
```
|
|
328
|
+
<!-- End Retries [retries] -->
|
|
329
|
+
|
|
330
|
+
<!-- Start Error Handling [errors] -->
|
|
331
|
+
## Error Handling
|
|
332
|
+
|
|
333
|
+
[`BereachError`](./src/models/errors/bereach-error.ts) is the base class for all HTTP error responses. It has the following properties:
|
|
334
|
+
|
|
335
|
+
| Property | Type | Description |
|
|
336
|
+
| ------------------- | ---------- | --------------------------------------------------------------------------------------- |
|
|
337
|
+
| `error.message` | `string` | Error message |
|
|
338
|
+
| `error.statusCode` | `number` | HTTP response status code eg `404` |
|
|
339
|
+
| `error.headers` | `Headers` | HTTP response headers |
|
|
340
|
+
| `error.body` | `string` | HTTP body. Can be empty string if no body is returned. |
|
|
341
|
+
| `error.rawResponse` | `Response` | Raw HTTP response |
|
|
342
|
+
| `error.data$` | | Optional. Some errors may contain structured data. [See Error Classes](#error-classes). |
|
|
343
|
+
|
|
344
|
+
### Example
|
|
345
|
+
```typescript
|
|
346
|
+
import { Bereach } from "bereach";
|
|
347
|
+
import * as errors from "bereach/models/errors";
|
|
348
|
+
|
|
349
|
+
const bereach = new Bereach({
|
|
350
|
+
token: "BEREACH_API_KEY",
|
|
351
|
+
});
|
|
352
|
+
|
|
353
|
+
async function run() {
|
|
354
|
+
try {
|
|
355
|
+
const result = await bereach.linkedinScrapers.collectLikes({
|
|
356
|
+
postUrl:
|
|
357
|
+
"https://www.linkedin.com/feed/update/urn:li:activity:1234567890123456789/",
|
|
358
|
+
start: 0,
|
|
359
|
+
});
|
|
360
|
+
|
|
361
|
+
console.log(result);
|
|
362
|
+
} catch (error) {
|
|
363
|
+
// The base class for HTTP error responses
|
|
364
|
+
if (error instanceof errors.BereachError) {
|
|
365
|
+
console.log(error.message);
|
|
366
|
+
console.log(error.statusCode);
|
|
367
|
+
console.log(error.body);
|
|
368
|
+
console.log(error.headers);
|
|
369
|
+
|
|
370
|
+
// Depending on the method different errors may be thrown
|
|
371
|
+
if (error instanceof errors.BadRequestError) {
|
|
372
|
+
console.log(error.data$.success); // boolean
|
|
373
|
+
console.log(error.data$.error); // operations.CollectLinkedInLikesBadRequestError
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
run();
|
|
380
|
+
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
### Error Classes
|
|
384
|
+
**Primary errors:**
|
|
385
|
+
* [`BereachError`](./src/models/errors/bereach-error.ts): The base class for HTTP error responses.
|
|
386
|
+
* [`BadRequestError`](./src/models/errors/bad-request-error.ts): The server cannot or will not process the request due to something that is perceived to be a client error. Status code `400`.
|
|
387
|
+
* [`UnauthorizedError`](./src/models/errors/unauthorized-error.ts): Although HTTP specifies "unauthorized", this response means "unauthenticated". Authenticate to continue. Status code `401`.
|
|
388
|
+
* [`ForbiddenError`](./src/models/errors/forbidden-error.ts): The client does not have access rights to the content. Status code `403`.
|
|
389
|
+
* [`NotFoundError`](./src/models/errors/not-found-error.ts): The server cannot find the requested resource. Status code `404`.
|
|
390
|
+
* [`ConflictError`](./src/models/errors/conflict-error.ts): The request conflicts with the current state of the server. Status code `409`.
|
|
391
|
+
* [`GoneError`](./src/models/errors/gone-error.ts): The requested content has been permanently deleted from the server. Status code `410`.
|
|
392
|
+
* [`UnprocessableEntityError`](./src/models/errors/unprocessable-entity-error.ts): The request was well-formed but was unable to be followed due to semantic errors. Status code `422`.
|
|
393
|
+
* [`TooManyRequestsError`](./src/models/errors/too-many-requests-error.ts): Rate limit exceeded. Read error.retryAfter for the wait time in seconds. Status code `429`.
|
|
394
|
+
* [`InternalServerError`](./src/models/errors/internal-server-error.ts): The server encountered a situation it does not know how to handle. Status code `500`.
|
|
395
|
+
|
|
396
|
+
<details><summary>Less common errors (6)</summary>
|
|
397
|
+
|
|
398
|
+
<br />
|
|
399
|
+
|
|
400
|
+
**Network errors:**
|
|
401
|
+
* [`ConnectionError`](./src/models/errors/http-client-errors.ts): HTTP client was unable to make a request to a server.
|
|
402
|
+
* [`RequestTimeoutError`](./src/models/errors/http-client-errors.ts): HTTP request timed out due to an AbortSignal signal.
|
|
403
|
+
* [`RequestAbortedError`](./src/models/errors/http-client-errors.ts): HTTP request was aborted by the client.
|
|
404
|
+
* [`InvalidRequestError`](./src/models/errors/http-client-errors.ts): Any input used to create a request is invalid.
|
|
405
|
+
* [`UnexpectedClientError`](./src/models/errors/http-client-errors.ts): Unrecognised or unexpected error.
|
|
406
|
+
|
|
407
|
+
|
|
408
|
+
**Inherit from [`BereachError`](./src/models/errors/bereach-error.ts)**:
|
|
409
|
+
* [`ResponseValidationError`](./src/models/errors/response-validation-error.ts): Type mismatch between the data returned from the server and the structure expected by the SDK. See `error.rawValue` for the raw value and `error.pretty()` for a nicely formatted multi-line string.
|
|
410
|
+
|
|
411
|
+
</details>
|
|
412
|
+
<!-- End Error Handling [errors] -->
|
|
413
|
+
|
|
414
|
+
<!-- Start Server Selection [server] -->
|
|
415
|
+
## Server Selection
|
|
416
|
+
|
|
417
|
+
### Override Server URL Per-Client
|
|
418
|
+
|
|
419
|
+
The default server can be overridden globally by passing a URL to the `serverURL: string` optional parameter when initializing the SDK client instance. For example:
|
|
420
|
+
```typescript
|
|
421
|
+
import { Bereach } from "bereach";
|
|
422
|
+
|
|
423
|
+
const bereach = new Bereach({
|
|
424
|
+
serverURL: "https://api.berea.ch",
|
|
425
|
+
token: "BEREACH_API_KEY",
|
|
426
|
+
});
|
|
427
|
+
|
|
428
|
+
async function run() {
|
|
429
|
+
const result = await bereach.linkedinScrapers.collectLikes({
|
|
430
|
+
postUrl:
|
|
431
|
+
"https://www.linkedin.com/feed/update/urn:li:activity:1234567890123456789/",
|
|
432
|
+
start: 0,
|
|
433
|
+
});
|
|
434
|
+
|
|
435
|
+
console.log(result);
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
run();
|
|
439
|
+
|
|
440
|
+
```
|
|
441
|
+
<!-- End Server Selection [server] -->
|
|
442
|
+
|
|
443
|
+
<!-- Start Custom HTTP Client [http-client] -->
|
|
444
|
+
## Custom HTTP Client
|
|
445
|
+
|
|
446
|
+
The TypeScript SDK makes API calls using an `HTTPClient` that wraps the native
|
|
447
|
+
[Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API). This
|
|
448
|
+
client is a thin wrapper around `fetch` and provides the ability to attach hooks
|
|
449
|
+
around the request lifecycle that can be used to modify the request or handle
|
|
450
|
+
errors and response.
|
|
451
|
+
|
|
452
|
+
The `HTTPClient` constructor takes an optional `fetcher` argument that can be
|
|
453
|
+
used to integrate a third-party HTTP client or when writing tests to mock out
|
|
454
|
+
the HTTP client and feed in fixtures.
|
|
455
|
+
|
|
456
|
+
The following example shows how to:
|
|
457
|
+
- route requests through a proxy server using [undici](https://www.npmjs.com/package/undici)'s ProxyAgent
|
|
458
|
+
- use the `"beforeRequest"` hook to add a custom header and a timeout to requests
|
|
459
|
+
- use the `"requestError"` hook to log errors
|
|
460
|
+
|
|
461
|
+
```typescript
|
|
462
|
+
import { Bereach } from "bereach";
|
|
463
|
+
import { ProxyAgent } from "undici";
|
|
464
|
+
import { HTTPClient } from "bereach/lib/http";
|
|
465
|
+
|
|
466
|
+
const dispatcher = new ProxyAgent("http://proxy.example.com:8080");
|
|
467
|
+
|
|
468
|
+
const httpClient = new HTTPClient({
|
|
469
|
+
// 'fetcher' takes a function that has the same signature as native 'fetch'.
|
|
470
|
+
fetcher: (input, init) =>
|
|
471
|
+
// 'dispatcher' is specific to undici and not part of the standard Fetch API.
|
|
472
|
+
fetch(input, { ...init, dispatcher } as RequestInit),
|
|
473
|
+
});
|
|
474
|
+
|
|
475
|
+
httpClient.addHook("beforeRequest", (request) => {
|
|
476
|
+
const nextRequest = new Request(request, {
|
|
477
|
+
signal: request.signal || AbortSignal.timeout(5000)
|
|
478
|
+
});
|
|
479
|
+
|
|
480
|
+
nextRequest.headers.set("x-custom-header", "custom value");
|
|
481
|
+
|
|
482
|
+
return nextRequest;
|
|
483
|
+
});
|
|
484
|
+
|
|
485
|
+
httpClient.addHook("requestError", (error, request) => {
|
|
486
|
+
console.group("Request Error");
|
|
487
|
+
console.log("Reason:", `${error}`);
|
|
488
|
+
console.log("Endpoint:", `${request.method} ${request.url}`);
|
|
489
|
+
console.groupEnd();
|
|
490
|
+
});
|
|
491
|
+
|
|
492
|
+
const sdk = new Bereach({ httpClient: httpClient });
|
|
493
|
+
```
|
|
494
|
+
<!-- End Custom HTTP Client [http-client] -->
|
|
495
|
+
|
|
496
|
+
<!-- Start Debugging [debug] -->
|
|
497
|
+
## Debugging
|
|
498
|
+
|
|
499
|
+
You can setup your SDK to emit debug logs for SDK requests and responses.
|
|
500
|
+
|
|
501
|
+
You can pass a logger that matches `console`'s interface as an SDK option.
|
|
502
|
+
|
|
503
|
+
> [!WARNING]
|
|
504
|
+
> Beware that debug logging will reveal secrets, like API tokens in headers, in log messages printed to a console or files. It's recommended to use this feature only during local development and not in production.
|
|
505
|
+
|
|
506
|
+
```typescript
|
|
507
|
+
import { Bereach } from "bereach";
|
|
508
|
+
|
|
509
|
+
const sdk = new Bereach({ debugLogger: console });
|
|
510
|
+
```
|
|
511
|
+
|
|
512
|
+
You can also enable a default debug logger by setting an environment variable `BEREACH_DEBUG` to true.
|
|
513
|
+
<!-- End Debugging [debug] -->
|
|
514
|
+
|
|
515
|
+
<!-- Placeholder for Future Speakeasy SDK Sections -->
|
|
516
|
+
|
|
517
|
+
# Development
|
|
518
|
+
|
|
519
|
+
## Maturity
|
|
520
|
+
|
|
521
|
+
This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage
|
|
522
|
+
to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally
|
|
523
|
+
looking for the latest version.
|
|
524
|
+
|
|
525
|
+
## Contributions
|
|
526
|
+
|
|
527
|
+
While we value open-source contributions to this SDK, this library is generated programmatically. Any manual changes added to internal files will be overwritten on the next generation.
|
|
528
|
+
We look forward to hearing your feedback. Feel free to open a PR or an issue with a proof of concept and we'll do our best to include it in a future release.
|
|
529
|
+
|
|
530
|
+
### SDK Created by [Speakeasy](https://www.speakeasy.com/?utm_source=bereach&utm_campaign=typescript)
|
package/RUNTIMES.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Supported JavaScript runtimes
|
|
2
|
+
|
|
3
|
+
This SDK is intended to be used in JavaScript runtimes that support ECMAScript 2020 or newer. The SDK uses the following features:
|
|
4
|
+
|
|
5
|
+
- [Web Fetch API][web-fetch]
|
|
6
|
+
- [Web Streams API][web-streams] and in particular `ReadableStream`
|
|
7
|
+
- [Async iterables][async-iter] using `Symbol.asyncIterator`
|
|
8
|
+
|
|
9
|
+
[web-fetch]: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API
|
|
10
|
+
[web-streams]: https://developer.mozilla.org/en-US/docs/Web/API/Streams_API
|
|
11
|
+
[async-iter]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols
|
|
12
|
+
|
|
13
|
+
Runtime environments that are explicitly supported are:
|
|
14
|
+
|
|
15
|
+
- Evergreen browsers which include: Chrome, Safari, Edge, Firefox
|
|
16
|
+
- Node.js active and maintenance LTS releases
|
|
17
|
+
- Currently, this is v18 and v20
|
|
18
|
+
- Bun v1 and above
|
|
19
|
+
- Deno v1.39
|
|
20
|
+
- Note that Deno does not currently have native support for streaming file uploads backed by the filesystem ([issue link][deno-file-streaming])
|
|
21
|
+
|
|
22
|
+
[deno-file-streaming]: https://github.com/denoland/deno/issues/11018
|
|
23
|
+
|
|
24
|
+
## Recommended TypeScript compiler options
|
|
25
|
+
|
|
26
|
+
The following `tsconfig.json` options are recommended for projects using this
|
|
27
|
+
SDK in order to get static type support for features like async iterables,
|
|
28
|
+
streams and `fetch`-related APIs ([`for await...of`][for-await-of],
|
|
29
|
+
[`AbortSignal`][abort-signal], [`Request`][request], [`Response`][response] and
|
|
30
|
+
so on):
|
|
31
|
+
|
|
32
|
+
[for-await-of]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of
|
|
33
|
+
[abort-signal]: https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal
|
|
34
|
+
[request]: https://developer.mozilla.org/en-US/docs/Web/API/Request
|
|
35
|
+
[response]: https://developer.mozilla.org/en-US/docs/Web/API/Response
|
|
36
|
+
|
|
37
|
+
```jsonc
|
|
38
|
+
{
|
|
39
|
+
"compilerOptions": {
|
|
40
|
+
"target": "es2020", // or higher
|
|
41
|
+
"lib": ["es2020", "dom", "dom.iterable"]
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
While `target` can be set to older ECMAScript versions, it may result in extra,
|
|
47
|
+
unnecessary compatibility code being generated if you are not targeting old
|
|
48
|
+
runtimes.
|
package/esm/core.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ClientSDK } from "./lib/sdks.js";
|
|
2
|
+
/**
|
|
3
|
+
* A minimal client to use when calling standalone SDK functions. Typically, an
|
|
4
|
+
* instance of this class would be instantiated once at the start of an
|
|
5
|
+
* application and passed around through some dependency injection mechanism to
|
|
6
|
+
* parts of an application that need to make SDK calls.
|
|
7
|
+
*/
|
|
8
|
+
export declare class BereachCore extends ClientSDK {
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=core.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C;;;;;GAKG;AACH,qBAAa,WAAY,SAAQ,SAAS;CAAG"}
|