diff --git a/README.md b/README.md index 4dc4120..778ec7e 100644 --- a/README.md +++ b/README.md @@ -354,7 +354,7 @@ const nvPeopleSearch = await linkedapi.account.salesNavigatorSearchPeople({ currentCompanies: ["Tech Solutions", "Innovatech"], previousCompanies: ["FutureCorp"], schools: ["Harvard University", "MIT"], - yearsOfExperience: ["0-1", "1-2", "3-5"], + yearsOfExperience: ["lessThanOne", "oneToTwo", "threeToFive"], }, }); ``` @@ -371,7 +371,7 @@ Send connection requests to LinkedIn users with optional personalized messages. ```typescript await linkedapi.account.sendConnectionRequest({ personUrl: "https://www.linkedin.com/in/john-doe", - message: "Hello! I'd love to connect and discuss opportunities.", + note: "Hello! I'd love to connect and discuss opportunities.", }); ``` @@ -559,7 +559,7 @@ Send messages to LinkedIn users through standard LinkedIn messaging. - **Returns:** `Promise>` - Workflow handler (no result data) ```typescript -await linkedapi.account.messaging.sendMessage({ +await linkedapi.account.sendMessage({ personUrl: "https://www.linkedin.com/in/john-doe", text: "Hello! I saw your post about AI and wanted to connect.", }); @@ -576,7 +576,7 @@ Sync conversation history with a LinkedIn user for message polling. - **Related Methods:** Use with `pollConversations()` to retrieve message history ```typescript -await linkedapi.account.messaging.syncConversation({ +await linkedapi.account.syncConversation({ personUrl: "https://www.linkedin.com/in/john-doe", }); ``` @@ -591,7 +591,7 @@ Send messages through Sales Navigator with enhanced messaging capabilities. - **Returns:** `Promise>` - Workflow handler (no result data) ```typescript -await linkedapi.account.messaging.salesNavigatorSendMessage({ +await linkedapi.account.salesNavigatorSendMessage({ personUrl: "https://www.linkedin.com/sales/people/ABC123", subject: "Partnership Opportunity", text: "Hi! I'd love to discuss potential collaboration opportunities.", @@ -608,7 +608,7 @@ Sync Sales Navigator conversation for message polling. - **Returns:** `Promise>` - Workflow handler (no result data) ```typescript -await linkedapi.account.messaging.salesNavigatorSyncConversation({ +await linkedapi.account.salesNavigatorSyncConversation({ personUrl: "https://www.linkedin.com/sales/people/ABC123", }); ``` @@ -624,7 +624,7 @@ Poll multiple conversations to retrieve message history and new messages. - **Prerequisites:** Must call `syncConversation()` or `salesNavigatorSyncConversation()` for each person before polling ```typescript -const response = await linkedapi.account.messaging.pollConversations([ +const response = await linkedapi.account.pollConversations([ { personUrl: "https://www.linkedin.com/in/john-doe", type: "st" }, { personUrl: "https://www.linkedin.com/sales/people/ABC123", @@ -835,7 +835,7 @@ const peopleSearchWorkflow = await linkedapi.data.searchPeople({ currentCompanies: ["Tech Solutions", "Innovatech"], previousCompanies: ["FutureCorp"], schools: ["Harvard University", "MIT"], - yearsOfExperience: ["0-1", "1-2", "3-5"], + yearsOfExperience: ["lessThanOne", "oneToTwo", "threeToFive"], }, }); ``` diff --git a/examples/messaging.ts b/examples/messaging.ts index 9665fec..f98c96d 100644 --- a/examples/messaging.ts +++ b/examples/messaging.ts @@ -42,7 +42,7 @@ async function sendMessage(linkedapi: LinkedApi, personUrl: string): Promise { console.log('\nšŸ“„ Polling conversations...'); - const pollResponse = await linkedapi.account.messaging.pollConversations([ + const pollResponse = await linkedapi.account.pollConversations([ { personUrl: standardPersonUrl, type: 'st', diff --git a/examples/search-people.ts b/examples/search-people.ts index 1ee75eb..5ade847 100644 --- a/examples/search-people.ts +++ b/examples/search-people.ts @@ -1,4 +1,4 @@ -import LinkedApi, { TSearchPeopleYearsOfExperience } from 'linkedapi-node'; +import LinkedApi, { TYearsOfExperience } from 'linkedapi-node'; async function searchPeopleExample(): Promise { const linkedapi = new LinkedApi({ @@ -60,12 +60,11 @@ async function salesNavigatorExample(linkedapi: LinkedApi): Promise { term: 'product manager', limit: 8, filter: { - firstName: 'Sarah', position: 'Product Manager', industries: ['Technology', 'Financial Services'], currentCompanies: ['Meta', 'Amazon', 'Netflix'], - previousCompanies: ['Uber', 'Airbnb'], - yearsOfExperience: ['3-5', '6-10'] as TSearchPeopleYearsOfExperience[], + previousCompanies: ['Uber', 'Airbnb', 'Microsoft'], + yearsOfExperience: ['threeToFive', 'sixToTen'] as TYearsOfExperience[], }, }; diff --git a/package.json b/package.json index 2b69f75..2a66fbd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "linkedapi-node", - "version": "1.0.0-alpha.1", + "version": "1.0.1", "description": "Official TypeScript SDK for Linked API", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/src/account-api/account-api.ts b/src/account-api/account-api.ts index fb53e02..686cbdc 100644 --- a/src/account-api/account-api.ts +++ b/src/account-api/account-api.ts @@ -69,8 +69,16 @@ import { SimpleWorkflowMapper } from "../core/simple-workflow-mapper"; import { WorkflowHandler } from "../core/workflow-handler"; import type { WorkflowExecutor } from "../core/workflow-executor"; import type { TBaseActionParams } from "../types/params"; -import { Messaging } from "./messaging"; import { HttpClient } from "../core/http-client"; +import { + TConversationPollRequest, + TConversationPollResponse, + TConversationPollResult, + TNvSendMessageParams, + TNvSyncConversationParams, + TSendMessageParams, + TSyncConversationParams, +} from "../types"; /** * Linked API Account API client for LinkedIn automation and data retrieval. @@ -93,13 +101,6 @@ import { HttpClient } from "../core/http-client"; * ``` */ export class AccountApi { - /** - * Messaging functionality for sending messages, syncing conversations, and polling messages. - * - * @see {@link https://linkedapi.io/docs/account-api/working-with-conversations/ Messaging Documentation} - */ - public readonly messaging: Messaging; - /** * Creates a new AccountApi instance. * @@ -109,9 +110,7 @@ export class AccountApi { constructor( private workflowExecutor: WorkflowExecutor, private readonly httpClient: HttpClient, - ) { - this.messaging = new Messaging(this.workflowExecutor, this.httpClient); - } + ) {} /** * Execute a custom workflow with raw workflow definition. @@ -188,6 +187,217 @@ export class AccountApi { return this.workflowExecutor.getWorkflowResult(workflowId); } + /** + * Send a message to a LinkedIn user via standard LinkedIn messaging. + * + * This method sends a direct message to a person on LinkedIn. The recipient must be a connection + * or allow messages from anyone. This uses the standard LinkedIn messaging interface. + * + * @param params - Parameters including the person's URL and message text + * @returns Promise resolving to a WorkflowHandler for the message sending action + * + * @see {@link https://linkedapi.io/docs/account-api/sending-message/ Sending Messages Documentation} + * @see {@link https://linkedapi.io/docs/account-api/action-st-send-message/ st.sendMessage Action Documentation} + * + * @example + * ```typescript + * const messageWorkflow = await linkedapi.account.sendMessage({ + * personUrl: "https://www.linkedin.com/in/john-doe", + * text: "Hi John! I saw your recent post about AI and would love to discuss further." + * }); + * + * await messageWorkflow.result(); + * console.log("Message sent successfully"); + * ``` + */ + public async sendMessage( + params: TSendMessageParams, + ): Promise> { + const sendMessageMapper = new VoidWorkflowMapper( + "st.sendMessage", + ); + const workflowDefinition = sendMessageMapper.mapRequest(params); + const { workflowId } = + await this.workflowExecutor.startWorkflow(workflowDefinition); + return new WorkflowHandler( + workflowId, + this.workflowExecutor, + sendMessageMapper, + ); + } + + /** + * Sync a conversation with a LinkedIn user for standard LinkedIn messaging. + * + * This method synchronizes a conversation with a person, preparing it for future message polling. + * Each conversation must be synced once before you can poll it for messages. This is a time-consuming + * process that retrieves the conversation history and prepares it for future updates. + * + * @param params - Parameters including the person's URL + * @returns Promise resolving to a WorkflowHandler for the sync action + * + * @see {@link https://linkedapi.io/docs/account-api/working-with-conversations/ Working with Conversations Documentation} + * @see {@link https://linkedapi.io/docs/account-api/action-st-sync-conversation/ st.syncConversation Action Documentation} + * + * @example + * ```typescript + * const syncWorkflow = await linkedapi.account.syncConversation({ + * personUrl: "https://www.linkedin.com/in/john-doe" + * }); + * + * await syncWorkflow.result(); + * console.log("Conversation synced and ready for polling"); + * ``` + */ + public async syncConversation( + params: TSyncConversationParams, + ): Promise> { + const syncConversationMapper = + new VoidWorkflowMapper("st.syncConversation"); + const workflowDefinition = syncConversationMapper.mapRequest(params); + const { workflowId } = + await this.workflowExecutor.startWorkflow(workflowDefinition); + return new WorkflowHandler( + workflowId, + this.workflowExecutor, + syncConversationMapper, + ); + } + + /** + * Send a message to a LinkedIn user via Sales Navigator. + * + * This method sends a direct message to a person using Sales Navigator's messaging capabilities. + * Sales Navigator allows messaging people who are not connections and provides enhanced messaging features. + * + * @param params - Parameters including the person's URL, message text, and subject line + * @returns Promise resolving to a WorkflowHandler for the message sending action + * + * @see {@link https://linkedapi.io/docs/account-api/sending-message/ Sending Messages Documentation} + * @see {@link https://linkedapi.io/docs/account-api/action-nv-send-message/ nv.sendMessage Action Documentation} + * + * @example + * ```typescript + * const nvMessageWorkflow = await linkedapi.account.salesNavigatorSendMessage({ + * personUrl: "https://www.linkedin.com/in/john-doe", + * text: "Hi John! I'm reaching out regarding potential collaboration opportunities.", + * subject: "Partnership Opportunity" + * }); + * + * await nvMessageWorkflow.result(); + * console.log("Sales Navigator message sent successfully"); + * ``` + */ + public async salesNavigatorSendMessage( + params: TNvSendMessageParams, + ): Promise> { + const nvSendMessageMapper = new VoidWorkflowMapper( + "nv.sendMessage", + ); + const workflowDefinition = nvSendMessageMapper.mapRequest(params); + const { workflowId } = + await this.workflowExecutor.startWorkflow(workflowDefinition); + return new WorkflowHandler( + workflowId, + this.workflowExecutor, + nvSendMessageMapper, + ); + } + + /** + * Sync a conversation with a LinkedIn user for Sales Navigator messaging. + * + * This method synchronizes a Sales Navigator conversation with a person, preparing it for future message polling. + * Each conversation must be synced once before you can poll it for messages. This retrieves the conversation + * history from Sales Navigator and prepares it for future updates. + * + * @param params - Parameters including the person's URL + * @returns Promise resolving to a WorkflowHandler for the sync action + * + * @see {@link https://linkedapi.io/docs/account-api/working-with-conversations/ Working with Conversations Documentation} + * @see {@link https://linkedapi.io/docs/account-api/action-nv-sync-conversation/ nv.syncConversation Action Documentation} + * + * @example + * ```typescript + * const nvSyncWorkflow = await linkedapi.account.salesNavigatorSyncConversation({ + * personUrl: "https://www.linkedin.com/in/john-doe" + * }); + * + * await nvSyncWorkflow.result(); + * console.log("Sales Navigator conversation synced and ready for polling"); + * ``` + */ + public async salesNavigatorSyncConversation( + params: TNvSyncConversationParams, + ): Promise> { + const nvSyncConversationMapper = + new VoidWorkflowMapper("nv.syncConversation"); + const workflowDefinition = nvSyncConversationMapper.mapRequest(params); + const { workflowId } = + await this.workflowExecutor.startWorkflow(workflowDefinition); + return new WorkflowHandler( + workflowId, + this.workflowExecutor, + nvSyncConversationMapper, + ); + } + + /** + * Poll multiple conversations to retrieve message history and new messages. + * + * This method retrieves messages from one or more previously synced conversations using direct HTTP requests. + * Unlike syncing, polling is fast and can be done continuously to get real-time message updates. + * You can specify a timestamp to get only messages since that time. + * + * @param conversations - Array of conversation requests specifying person URLs, types, and optional timestamps + * @returns Promise resolving to a response containing conversation data and messages + * + * @see {@link https://linkedapi.io/docs/account-api/working-with-conversations/ Working with Conversations Documentation} + * + * @example + * ```typescript + * // Poll multiple conversations + * const pollResponse = await linkedapi.account.pollConversations([ + * { + * personUrl: "https://www.linkedin.com/in/john-doe", + * type: "st", + * since: "2023-01-01T00:00:00Z" + * }, + * { + * personUrl: "https://www.linkedin.com/in/jane-smith", + * type: "nv" + * } + * ]); + * + * if (pollResponse.success) { + * pollResponse.result?.forEach(conversation => { + * console.log(`Conversation with ${conversation.personUrl}:`); + * console.log(`Messages: ${conversation.messages.length}`); + * + * conversation.messages.forEach(message => { + * console.log(`${message.sender}: ${message.text}`); + * }); + * }); + * } else { + * console.error("Polling failed:", pollResponse.error?.message); + * } + * ``` + */ + public async pollConversations( + conversations: TConversationPollRequest[], + ): Promise { + const response = await this.httpClient.post( + "/account/conversations/poll", + conversations, + ); + + return { + success: response.success, + result: response.result, + error: response.error, + }; + } + /** * Retrieve detailed information about a LinkedIn person profile. * @@ -655,7 +865,7 @@ export class AccountApi { * ```typescript * const connectionWorkflow = await linkedapi.account.sendConnectionRequest({ * personUrl: "https://www.linkedin.com/in/john-doe", - * message: "Hi John, I'd love to connect and discuss opportunities in tech!" + * note: "Hi John, I'd love to connect and discuss opportunities in tech!" * }); * * await connectionWorkflow.result(); diff --git a/src/account-api/messaging.ts b/src/account-api/messaging.ts deleted file mode 100644 index 8294528..0000000 --- a/src/account-api/messaging.ts +++ /dev/null @@ -1,264 +0,0 @@ -import type { - TSendMessageParams, - TSyncConversationParams, - TNvSendMessageParams, - TNvSyncConversationParams, - TConversationPollRequest, - TConversationPollResult, - TConversationPollResponse, -} from "../types/actions/message"; -import { VoidWorkflowMapper } from "../core/void-workflow-mapper"; -import { WorkflowHandler } from "../core/workflow-handler"; -import type { WorkflowExecutor } from "../core/workflow-executor"; -import { HttpClient } from "../core/http-client"; - -/** - * LinkedIn messaging functionality for the Account API. - * - * This class provides methods for sending messages, syncing conversations, and polling message history - * on both standard LinkedIn and Sales Navigator platforms. It supports workflow-based messaging actions - * and HTTP-based conversation polling. - * - * @see {@link https://linkedapi.io/docs/account-api/working-with-conversations/ Working with Conversations Documentation} - * @see {@link https://linkedapi.io/docs/account-api/sending-message/ Sending Messages Documentation} - * - * @example - * ```typescript - * // Access messaging through the Account API - * const linkedapi = new LinkedApi({ accountApiToken: "...", identificationToken: "..." }); - * - * // Send a message - * await linkedapi.account.messaging.sendMessage({ - * personUrl: "https://www.linkedin.com/in/john-doe", - * text: "Hello! I'd love to connect." - * }); - * - * // Poll conversations - * const response = await linkedapi.account.messaging.pollConversations([ - * { personUrl: "https://www.linkedin.com/in/john-doe", type: "st" } - * ]); - * ``` - */ -export class Messaging { - /** - * Creates a new Messaging instance. - * - * @param workflowExecutor - The workflow executor for managing LinkedIn automation workflows - * @param httpClient - HTTP client configured with authentication headers for API requests - */ - constructor( - private workflowExecutor: WorkflowExecutor, - private httpClient: HttpClient, - ) {} - - /** - * Send a message to a LinkedIn user via standard LinkedIn messaging. - * - * This method sends a direct message to a person on LinkedIn. The recipient must be a connection - * or allow messages from anyone. This uses the standard LinkedIn messaging interface. - * - * @param params - Parameters including the person's URL and message text - * @returns Promise resolving to a WorkflowHandler for the message sending action - * - * @see {@link https://linkedapi.io/docs/account-api/sending-message/ Sending Messages Documentation} - * @see {@link https://linkedapi.io/docs/account-api/action-st-send-message/ st.sendMessage Action Documentation} - * - * @example - * ```typescript - * const messageWorkflow = await linkedapi.account.messaging.sendMessage({ - * personUrl: "https://www.linkedin.com/in/john-doe", - * text: "Hi John! I saw your recent post about AI and would love to discuss further." - * }); - * - * await messageWorkflow.result(); - * console.log("Message sent successfully"); - * ``` - */ - public async sendMessage( - params: TSendMessageParams, - ): Promise> { - const sendMessageMapper = new VoidWorkflowMapper( - "st.sendMessage", - ); - const workflowDefinition = sendMessageMapper.mapRequest(params); - const { workflowId } = - await this.workflowExecutor.startWorkflow(workflowDefinition); - return new WorkflowHandler( - workflowId, - this.workflowExecutor, - sendMessageMapper, - ); - } - - /** - * Sync a conversation with a LinkedIn user for standard LinkedIn messaging. - * - * This method synchronizes a conversation with a person, preparing it for future message polling. - * Each conversation must be synced once before you can poll it for messages. This is a time-consuming - * process that retrieves the conversation history and prepares it for future updates. - * - * @param params - Parameters including the person's URL - * @returns Promise resolving to a WorkflowHandler for the sync action - * - * @see {@link https://linkedapi.io/docs/account-api/working-with-conversations/ Working with Conversations Documentation} - * @see {@link https://linkedapi.io/docs/account-api/action-st-sync-conversation/ st.syncConversation Action Documentation} - * - * @example - * ```typescript - * const syncWorkflow = await linkedapi.account.messaging.syncConversation({ - * personUrl: "https://www.linkedin.com/in/john-doe" - * }); - * - * await syncWorkflow.result(); - * console.log("Conversation synced and ready for polling"); - * ``` - */ - public async syncConversation( - params: TSyncConversationParams, - ): Promise> { - const syncConversationMapper = - new VoidWorkflowMapper("st.syncConversation"); - const workflowDefinition = syncConversationMapper.mapRequest(params); - const { workflowId } = - await this.workflowExecutor.startWorkflow(workflowDefinition); - return new WorkflowHandler( - workflowId, - this.workflowExecutor, - syncConversationMapper, - ); - } - - /** - * Send a message to a LinkedIn user via Sales Navigator. - * - * This method sends a direct message to a person using Sales Navigator's messaging capabilities. - * Sales Navigator allows messaging people who are not connections and provides enhanced messaging features. - * - * @param params - Parameters including the person's URL, message text, and subject line - * @returns Promise resolving to a WorkflowHandler for the message sending action - * - * @see {@link https://linkedapi.io/docs/account-api/sending-message/ Sending Messages Documentation} - * @see {@link https://linkedapi.io/docs/account-api/action-nv-send-message/ nv.sendMessage Action Documentation} - * - * @example - * ```typescript - * const nvMessageWorkflow = await linkedapi.account.messaging.salesNavigatorSendMessage({ - * personUrl: "https://www.linkedin.com/in/john-doe", - * text: "Hi John! I'm reaching out regarding potential collaboration opportunities.", - * subject: "Partnership Opportunity" - * }); - * - * await nvMessageWorkflow.result(); - * console.log("Sales Navigator message sent successfully"); - * ``` - */ - public async salesNavigatorSendMessage( - params: TNvSendMessageParams, - ): Promise> { - const nvSendMessageMapper = new VoidWorkflowMapper( - "nv.sendMessage", - ); - const workflowDefinition = nvSendMessageMapper.mapRequest(params); - const { workflowId } = - await this.workflowExecutor.startWorkflow(workflowDefinition); - return new WorkflowHandler( - workflowId, - this.workflowExecutor, - nvSendMessageMapper, - ); - } - - /** - * Sync a conversation with a LinkedIn user for Sales Navigator messaging. - * - * This method synchronizes a Sales Navigator conversation with a person, preparing it for future message polling. - * Each conversation must be synced once before you can poll it for messages. This retrieves the conversation - * history from Sales Navigator and prepares it for future updates. - * - * @param params - Parameters including the person's URL - * @returns Promise resolving to a WorkflowHandler for the sync action - * - * @see {@link https://linkedapi.io/docs/account-api/working-with-conversations/ Working with Conversations Documentation} - * @see {@link https://linkedapi.io/docs/account-api/action-nv-sync-conversation/ nv.syncConversation Action Documentation} - * - * @example - * ```typescript - * const nvSyncWorkflow = await linkedapi.account.messaging.salesNavigatorSyncConversation({ - * personUrl: "https://www.linkedin.com/in/john-doe" - * }); - * - * await nvSyncWorkflow.result(); - * console.log("Sales Navigator conversation synced and ready for polling"); - * ``` - */ - public async salesNavigatorSyncConversation( - params: TNvSyncConversationParams, - ): Promise> { - const nvSyncConversationMapper = - new VoidWorkflowMapper("nv.syncConversation"); - const workflowDefinition = nvSyncConversationMapper.mapRequest(params); - const { workflowId } = - await this.workflowExecutor.startWorkflow(workflowDefinition); - return new WorkflowHandler( - workflowId, - this.workflowExecutor, - nvSyncConversationMapper, - ); - } - - /** - * Poll multiple conversations to retrieve message history and new messages. - * - * This method retrieves messages from one or more previously synced conversations using direct HTTP requests. - * Unlike syncing, polling is fast and can be done continuously to get real-time message updates. - * You can specify a timestamp to get only messages since that time. - * - * @param conversations - Array of conversation requests specifying person URLs, types, and optional timestamps - * @returns Promise resolving to a response containing conversation data and messages - * - * @see {@link https://linkedapi.io/docs/account-api/working-with-conversations/ Working with Conversations Documentation} - * - * @example - * ```typescript - * // Poll multiple conversations - * const pollResponse = await linkedapi.account.messaging.pollConversations([ - * { - * personUrl: "https://www.linkedin.com/in/john-doe", - * type: "st", - * since: "2023-01-01T00:00:00Z" - * }, - * { - * personUrl: "https://www.linkedin.com/in/jane-smith", - * type: "nv" - * } - * ]); - * - * if (pollResponse.success) { - * pollResponse.result?.forEach(conversation => { - * console.log(`Conversation with ${conversation.personUrl}:`); - * console.log(`Messages: ${conversation.messages.length}`); - * - * conversation.messages.forEach(message => { - * console.log(`${message.sender}: ${message.text}`); - * }); - * }); - * } else { - * console.error("Polling failed:", pollResponse.error?.message); - * } - * ``` - */ - public async pollConversations( - conversations: TConversationPollRequest[], - ): Promise { - const response = await this.httpClient.post( - "/account/conversations/poll", - conversations, - ); - - return { - success: response.success, - result: response.result, - error: response.error, - }; - } -} diff --git a/src/data-api/data-api.ts b/src/data-api/data-api.ts index 7a3fa0c..d7a304c 100644 --- a/src/data-api/data-api.ts +++ b/src/data-api/data-api.ts @@ -313,7 +313,7 @@ export class DataApi { * currentCompanies: ["Google", "Facebook", "Apple"], * industries: ["Technology", "Software"], * schools: ["Stanford University", "MIT"], - * yearsOfExperience: ["3-5", "6-10"] + * yearsOfExperience: ["threeToFive", "sixToTen"] * } * }); * diff --git a/src/types/actions/company.sales-navigator.ts b/src/types/actions/company.sales-navigator.ts index 6d37c20..5ebc05a 100644 --- a/src/types/actions/company.sales-navigator.ts +++ b/src/types/actions/company.sales-navigator.ts @@ -1,3 +1,4 @@ +import { TYearsOfExperience } from "./person"; import { TBaseActionParams, TLimitParams } from "../params"; export interface TNvCompany { @@ -102,13 +103,6 @@ export interface TNvCompanyEmployeeRetrievalConfig extends TLimitParams { locations?: string[]; industries?: string[]; schools?: string[]; - yearsOfExperiences?: TNvYearsOfExperience[]; + yearsOfExperiences?: TYearsOfExperience[]; }; } - -export type TNvYearsOfExperience = - | "lessThanOne" - | "oneToTwo" - | "threeToFive" - | "sixToTen" - | "moreThanTen"; diff --git a/src/types/actions/person.ts b/src/types/actions/person.ts index 7f73ef6..55175fb 100644 --- a/src/types/actions/person.ts +++ b/src/types/actions/person.ts @@ -127,3 +127,10 @@ export type TLanguageProficiency = | "professionalWorking" | "fullProfessional" | "nativeOrBilingual"; + +export type TYearsOfExperience = + | "lessThanOne" + | "oneToTwo" + | "threeToFive" + | "sixToTen" + | "moreThanTen"; diff --git a/src/types/actions/search-people.ts b/src/types/actions/search-people.ts index a9dd6c0..0f3975e 100644 --- a/src/types/actions/search-people.ts +++ b/src/types/actions/search-people.ts @@ -1,3 +1,4 @@ +import { TYearsOfExperience } from "./person"; import { TBaseActionParams } from "../params"; export interface TSearchPeopleParams extends TBaseActionParams { @@ -34,17 +35,10 @@ export interface TNvSearchPeopleParams extends TBaseActionParams { currentCompanies?: string[]; previousCompanies?: string[]; schools?: string[]; - yearsOfExperience?: TSearchPeopleYearsOfExperience[]; + yearsOfExperience?: TYearsOfExperience[]; }; } -export type TSearchPeopleYearsOfExperience = - | "0-1" - | "1-2" - | "3-5" - | "6-10" - | "10+"; - export interface TNvSearchPeopleResult { name: string; hashedUrl: string;