UNPKG

@simplyhomes/sos-client

Version:

Client SDK for SimplyHomes SOS API

164 lines (163 loc) 6.7 kB
import { SDK_Base } from '../../base'; import { SDK_Execution } from 'sdk/interfaces/sdk-execution'; import { SDK_GetProperties_Response_Dto } from './types'; import { SDK_GetProperties_IncludedFieldsType } from './types'; import { SDK_Context } from 'sdk/client/client'; export declare class SDK_Properties_List extends SDK_Base implements SDK_Execution { private payload; private includedFields?; constructor(context: SDK_Context); /** * Sets the maximum number of properties to return in the response. * @param limit - Maximum number of records to return (default varies by API) * @returns The current instance for method chaining */ limit(limit: number): this; /** * Sets the offset for pagination. * @param offset - Number of records to skip before starting to collect the result set * @returns The current instance for method chaining */ offset(offset: number): this; /** * Sets the maximum number of properties to return in the response without pagination. * @param noLimit - If true, no limit is applied to the number of records returned * @returns The current instance for method chaining */ noLimit(noLimit: boolean): this; /** * Sets the sorting criteria for the property results. * @param sortBy - Field to sort by: * 'CREATED_TIME' | 'ASKING_PRICE' | 'MAX_PRICE' | 'DELTA_MAX_ASKING_PRICE' * @param order - Sort direction: 'ASC' (ascending) or 'DESC' (descending) * @returns The current instance for method chaining */ sort(sortBy: 'CREATED_TIME' | 'ASKING_PRICE' | 'MAX_PRICE' | 'DELTA_MAX_ASKING_PRICE', order: 'ASC' | 'DESC'): this; /** * Filters properties by sort. * @param sort - Sort string to search for * @returns The current instance for method chaining */ withSort(sort: string): this; /** * Filters properties by number of bedrooms. * Can be called with: * - Exact number: .withBedrooms(3) * - Range: .withBedrooms(2, 4) * - Options object: .withBedrooms({ min: 2, max: 4 }) or .withBedrooms({ exact: 3 }) * @param arg1 - Exact number, min value, or options object * @param arg2 - Optional max value when using range * @returns The current instance for method chaining */ withBedrooms(bedrooms: number): this; withBedrooms(min: number, max: number): this; withBedrooms(options: { min?: number; max?: number; exact?: number; }): this; /** * Filters properties by number of bathrooms. * Can be called with: * - Exact number: .withBathrooms(2) * - Range: .withBathrooms(1, 3) * - Options object: .withBathrooms({ min: 1, max: 3 }) or .withBathrooms({ exact: 2 }) * @param arg1 - Exact number, min value, or options object * @param arg2 - Optional max value when using range * @returns The current instance for method chaining */ withBathrooms(bathrooms: number): this; withBathrooms(min: number, max: number): this; withBathrooms(options: { min?: number; max?: number; exact?: number; }): this; /** * Filters properties by address. * @param address - Address string to search for * @returns The current instance for method chaining */ withAddress(address: string): this; /** * Filters properties by status * @param status - Status string to search for * @note For a complete list of available status options, you can use the SDK Options * @example * // Get available statuses first * const statuses = await client.options.properties.statuses.list().execute(); * @returns The current instance for method chaining */ withStatus(status: string): this; /** * Filters properties by status * @param propertyTypes - types to search for * @note For a complete list of available status options, you can use the SDK Options * @example * // Get available types first * const types = await client.options.properties.types.list(housingAuthorityName).execute(); * @returns The current instance for method chaining */ withPropertyTypes(propertyTypes: string[]): this; /** * Filters properties by state codes (e.g., ['CA', 'NY', ...]). * @param states - Array of state codes to include * @returns The current instance for method chaining */ withStates(states: string[]): this; /** * Filters properties by ZIP codes. * @param zips - Array of ZIP codes to include * @returns The current instance for method chaining */ withZips(zips: string[]): this; /** * Filters properties by market identifiers. * @param markets - Array of market name to include * @returns The current instance for method chaining */ withMarkets(markets: string[]): this; /** * Filters properties by data sources (e.g., ['HomeSmart/OneHome.com', 'Wholesaler', DTS', 'MLS', 'Airtable', 'Generic']). * @param sources - Array of source identifiers to include * @returns The current instance for method chaining */ withSources(sources: string[]): this; /** * Sets the minimum price filter for properties. * @param minSourcePrice - Minimum price value * @returns The current instance for method chaining */ withMinSourcePrice(minSourcePrice: number): this; /** * Sets the maximum price filter for properties. * @param maxSourcePrice - Maximum price value * @returns The current instance for method chaining */ withMaxSourcePrice(maxSourcePrice: number): this; /** * Filters properties based on whether they have leads associated. * @param hasLead - true to only include properties with leads, false for without * @returns The current instance for method chaining */ withHasLead(hasLead: boolean): this; /** * Filters properties by offer statuses. * @param offerStatuses - Array of offer status values to include * @returns The current instance for method chaining */ withOfferStatuses(offerStatuses: string[]): this; /** * Specifies additional fields to include in the response. * @param fields - Array of field identifiers to include * @returns The current instance for method chaining */ included(fields: SDK_GetProperties_IncludedFieldsType[]): this; /** * Executes the query with all specified filters and options. * @returns Promise resolving to the property list response */ execute(): Promise<SDK_GetProperties_Response_Dto>; private clonePayload; private resetPayload; }