interface ListsService {
    addListUser(listUser: BaseListUser): Promise<SavedListUser>;
    addListUserSources(
        listUserId: string,
        sources: string[],
    ): Promise<null | SavedListUser>;
    addListUserToHostMarketingList(
        hostId: string,
        listUserCreate: HostMarketingListUserCreate,
    ): Promise<SavedListUser>;
    createConfirmedTravelerList(
        userId: string,
        name: string,
        tripId: string,
    ): Promise<SavedList>;
    createHostMarketingList(hostId: string, name: string): Promise<SavedList>;
    createPendingTravelerList(
        userId: string,
        name: string,
        tripId: string,
    ): Promise<SavedList>;
    createWaitlistedTravelerList(
        userId: string,
        name: string,
        tripId: string,
    ): Promise<SavedList>;
    deleteListUser(listUserId: string): Promise<null | SavedListUser>;
    deleteTripListUsersByEmails(
        tripId: string,
        emails: string[],
    ): Promise<number>;
    deleteTripListUsersByUserIds(
        tripId: string,
        userIds: string[],
    ): Promise<number>;
    exportAudienceReport(
        hostId: string,
        extendedData?: boolean,
        jobId?: string,
    ): Promise<SavedReport>;
    findById(
        id: string,
        listQueryOptions?: ListQueryOptions<BaseList>,
    ): Promise<SavedList>;
    findByUserId(userId: string): Promise<SavedList[]>;
    findLists(query: Query<BaseList>): Promise<SavedList[]>;
    findListUserById(id: string): Promise<SavedListUser>;
    findListUsers(query: Query<BaseListUser>): Promise<SavedListUser[]>;
    getHostMarketingListLength(): Promise<number>;
    restoreBookedTravelers(hostId: string, tripId: string): Promise<void>;
    suppressBookedTravelers(hostId: string, tripId: string): Promise<void>;
    updateListUser(
        listUserId: string,
        listUserUpdate: ListUserUpdate,
    ): Promise<SavedListUser>;
    updateListUserList(
        listUserId: string,
        listId: string,
    ): Promise<null | SavedListUser>;
    updateListUsersByNormalizedEmail(
        normalizedEmail: string,
        params: Partial<Pick<BaseListUser, "email" | "userId">>,
    ): Promise<number>;
}

Methods

  • Persists a new List instance of confirmed traveler type, and creates a list on mailgun

    Parameters

    • userId: string
    • name: string
    • tripId: string

      this param is used to build the identifier for the mailgunListId

    Returns Promise<SavedList>

  • Persists a new List instance of pending traveler type, and creates a list on mailgun

    Parameters

    • userId: string
    • name: string
    • tripId: string

      this param is used to build the identifier for the mailgunListId

    Returns Promise<SavedList>

  • Persists a new List instance of waitlisted traveler type, and creates a list on mailgun

    Parameters

    • userId: string
    • name: string
    • tripId: string

      this param is used to build the identifier for the mailgunListId

    Returns Promise<SavedList>

  • Deletes one or more ListUsers by their user emails

    Parameters

    • tripId: string

      the tripId to get the email lists

    • emails: string[]

      the user emails from the list users to delete

    Returns Promise<number>

    the number of ListUsers deleted

  • Deletes one or more ListUsers by their user ids

    Parameters

    • tripId: string

      the tripId to get the email lists

    • userIds: string[]

      the user ids from the list users to delete

    Returns Promise<number>

    the number of ListUsers deleted

  • Export the host marketing list to a csv file.

    Parameters

    • hostId: string

      the id of the host.

    • OptionalextendedData: boolean

      whether to include extended data in the export.

    • OptionaljobId: string

      the id of the job that triggered the export.

    Returns Promise<SavedReport>

  • The opposite of suppress booked travelers. Adds the contacts from the pending and confirmed travelers list to the host marketing list.

    Parameters

    • hostId: string

      the id of the trips host.

    • tripId: string

      the id of the trip.

    Returns Promise<void>

  • Remove the emails on the trip's pending and confirmed travelers list from the host marketing list. The listUsers are not deleted, only the emails are removed from the email service.

    This isn't great. But it's a workaround.

    Parameters

    • hostId: string

      the id of the trips host.

    • tripId: string

      the id of the trip to suppress.

    Returns Promise<void>

  • Update all list users by the specified normalized email.

    Parameters

    • normalizedEmail: string

      the normalized email to search for.

    • params: Partial<Pick<BaseListUser, "email" | "userId">>

      list user properties to update ListUsersUpdateParams.

    Returns Promise<number>

    • the number of list users updated.