Skip to content

Commit dea024c

Browse files
Add error types to SDK (#12)
1 parent e06fc21 commit dea024c

3 files changed

Lines changed: 28 additions & 2 deletions

File tree

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@linkedapi/node",
3-
"version": "2.3.19",
3+
"version": "2.3.20",
44
"description": "Control your LinkedIn accounts and retrieve real-time data, all through this Node.js SDK.",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

‎src/types/admin/subscription.type.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export interface TSubscriptionStatus {
2-
status: 'active' | 'trialing' | 'past_due' | 'canceled' | undefined;
2+
status: 'active' | 'trialing' | 'past_due' | 'unpaid' | 'canceled' | undefined;
33
eligibleForTrial: boolean;
44
cancelAtPeriodEnd: boolean;
55
}

‎src/types/errors.ts‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,17 @@ import { TOperationName } from '../core';
77
* Common types:
88
* - personNotFound (sendMessage, syncConversation, checkConnectionStatus, sendConnectionRequest, withdrawConnectionRequest, removeConnection, endorsePersonSkill, endorsePersonSkills, fetchPerson, nvSendMessage, nvSyncConversation, nvFetchPerson)
99
* - selfProfileNotAllowed (fetchPerson, nvFetchPerson)
10+
* - personLikelyChangedPublicUrl (fetchPerson, sendMessage)
1011
* - messagingNotAllowed (sendMessage, nvSendMessage)
1112
* - alreadyPending (sendConnectionRequest)
1213
* - alreadyConnected (sendConnectionRequest)
1314
* - emailRequired (sendConnectionRequest)
1415
* - noteTooLong (sendConnectionRequest)
1516
* - noteLimitExceeded (sendConnectionRequest)
17+
* - invitationAlreadyReceived (sendConnectionRequest)
1618
* - requestNotAllowed (sendConnectionRequest)
1719
* - notPending (withdrawConnectionRequest))
20+
* - noPendingRequest (acceptInvitation, ignoreInvitation)
1821
* - retrievingNotAllowed (retrieveConnections, fetchCompany, nvFetchCompany)
1922
* - connectionNotFound (removeConnection, endorsePersonSkill, endorsePersonSkills)
2023
* - skillNotFound (endorsePersonSkill)
@@ -23,6 +26,7 @@ import { TOperationName } from '../core';
2326
* - searchingNotAllowed (searchCompanies, searchPeople, searchJobs, searchPosts, nvSearchCompanies, nvSearchPeople)
2427
* - filterNotApplied (searchPeople, searchCompanies, searchPosts, retrieveConnections, fetchCompany, nvSearchPeople, nvSearchCompanies, nvFetchCompany)
2528
* - searchInterfaceMismatch (searchJobs)
29+
* - searchTemporarilyUnavailable (nvSearchCompanies, nvSearchPeople, nvFetchCompany)
2630
* - companyNotFound (fetchCompany, nvFetchCompany)
2731
* - postNotFound (fetchPost, reactToPost, commentOnPost, createRepost)
2832
* - jobNotFound (fetchJob)
@@ -31,31 +35,40 @@ import { TOperationName } from '../core';
3135
* - replyingNotAllowed (replyToComment)
3236
* - duplicateComment (commentOnPost, replyToComment)
3337
* - noPostingPermission (createPost, reactToPost, commentOnPost)
38+
* - textTooLong (createPost)
39+
* - unsupportedAttachmentType, missingDocumentName, urlNotAccessible, fileTooLarge, unsupportedMimeType, tooManyAttachments, mixingNotAllowed (createPost)
3440
* - mentionNotResolved (createPost, createRepost)
3541
* - repostNotAllowed (createRepost)
3642
* - alreadyReposted (createRepost)
3743
* - noSalesNavigator (nvSendMessage, nvSyncConversation, nvSyncInbox, nvSearchCompanies, nvSearchPeople, nvFetchCompany, nvFetchPerson, nvManageConversation)
44+
* - salesNavigatorOnboardingRequired (nvSearchCompanies, nvSearchPeople)
3845
* - conversationsNotSynced (pollConversations)
3946
* - threadNotFound (manageConversation, nvManageConversation)
47+
* - ssiNotAvailable (retrieveSSI)
48+
* - unexpectedError (any operation)
4049
*/
4150
export const LINKED_API_ACTION_ERROR = {
4251
personNotFound: 'personNotFound',
4352
selfProfileNotAllowed: 'selfProfileNotAllowed',
53+
personLikelyChangedPublicUrl: 'personLikelyChangedPublicUrl',
4454
messagingNotAllowed: 'messagingNotAllowed',
4555
alreadyPending: 'alreadyPending',
4656
alreadyConnected: 'alreadyConnected',
4757
emailRequired: 'emailRequired',
4858
noteTooLong: 'noteTooLong',
4959
noteLimitExceeded: 'noteLimitExceeded',
60+
invitationAlreadyReceived: 'invitationAlreadyReceived',
5061
requestNotAllowed: 'requestNotAllowed',
5162
notPending: 'notPending',
63+
noPendingRequest: 'noPendingRequest',
5264
retrievingNotAllowed: 'retrievingNotAllowed',
5365
connectionNotFound: 'connectionNotFound',
5466
skillNotFound: 'skillNotFound',
5567
endorsementUnavailable: 'endorsementUnavailable',
5668
limitExceeded: 'limitExceeded',
5769
searchingNotAllowed: 'searchingNotAllowed',
5870
searchInterfaceMismatch: 'searchInterfaceMismatch',
71+
searchTemporarilyUnavailable: 'searchTemporarilyUnavailable',
5972
filterNotApplied: 'filterNotApplied',
6073
companyNotFound: 'companyNotFound',
6174
postNotFound: 'postNotFound',
@@ -65,12 +78,23 @@ export const LINKED_API_ACTION_ERROR = {
6578
replyingNotAllowed: 'replyingNotAllowed',
6679
duplicateComment: 'duplicateComment',
6780
noPostingPermission: 'noPostingPermission',
81+
textTooLong: 'textTooLong',
82+
unsupportedAttachmentType: 'unsupportedAttachmentType',
83+
missingDocumentName: 'missingDocumentName',
84+
urlNotAccessible: 'urlNotAccessible',
85+
fileTooLarge: 'fileTooLarge',
86+
unsupportedMimeType: 'unsupportedMimeType',
87+
tooManyAttachments: 'tooManyAttachments',
88+
mixingNotAllowed: 'mixingNotAllowed',
6889
mentionNotResolved: 'mentionNotResolved',
6990
repostNotAllowed: 'repostNotAllowed',
7091
alreadyReposted: 'alreadyReposted',
7192
noSalesNavigator: 'noSalesNavigator',
93+
salesNavigatorOnboardingRequired: 'salesNavigatorOnboardingRequired',
7294
conversationsNotSynced: 'conversationsNotSynced',
7395
threadNotFound: 'threadNotFound',
96+
ssiNotAvailable: 'ssiNotAvailable',
97+
unexpectedError: 'unexpectedError',
7498
} as const;
7599
export type TLinkedApiActionErrorType =
76100
(typeof LINKED_API_ACTION_ERROR)[keyof typeof LINKED_API_ACTION_ERROR];
@@ -99,6 +123,8 @@ export const LINKED_API_ERROR = {
99123
workflowTimeout: 'workflowTimeout',
100124
outsideWorkingHours: 'outsideWorkingHours',
101125
workingHoursWaitExpired: 'workingHoursWaitExpired',
126+
cancelledByUser: 'cancelledByUser',
127+
unexpectedError: 'unexpectedError',
102128
httpError: 'httpError',
103129
tooManyRequests: 'tooManyRequests',
104130
accountNotFound: 'accountNotFound',

0 commit comments

Comments
 (0)