@horizon-modules/property-model-v3
Version:
Modelo de propriedades imobiliárias v3 - Sistema de atributos dinâmicos
1,338 lines (1,326 loc) • 36.5 kB
text/typescript
import { z } from 'zod';
declare const ImageMediaSchema: z.ZodObject<{
full: z.ZodString;
md: z.ZodOptional<z.ZodString>;
sm: z.ZodOptional<z.ZodString>;
cover: z.ZodOptional<z.ZodBoolean>;
}, "strip", z.ZodTypeAny, {
full: string;
md?: string | undefined;
sm?: string | undefined;
cover?: boolean | undefined;
}, {
full: string;
md?: string | undefined;
sm?: string | undefined;
cover?: boolean | undefined;
}>;
declare const VideoMediaSchema: z.ZodObject<{
provider: z.ZodOptional<z.ZodString>;
id: z.ZodOptional<z.ZodString>;
embed_url: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
embed_url?: string | undefined;
provider?: string | undefined;
id?: string | undefined;
}, {
embed_url?: string | undefined;
provider?: string | undefined;
id?: string | undefined;
}>;
declare const DocumentMediaSchema: z.ZodObject<{
name: z.ZodString;
url: z.ZodString;
}, "strip", z.ZodTypeAny, {
name: string;
url: string;
}, {
name: string;
url: string;
}>;
declare const VirtualTourMediaSchema: z.ZodObject<{
embed_url: z.ZodString;
}, "strip", z.ZodTypeAny, {
embed_url: string;
}, {
embed_url: string;
}>;
declare const MediaAssetsSchema: z.ZodObject<{
images: z.ZodOptional<z.ZodArray<z.ZodObject<{
full: z.ZodString;
md: z.ZodOptional<z.ZodString>;
sm: z.ZodOptional<z.ZodString>;
cover: z.ZodOptional<z.ZodBoolean>;
}, "strip", z.ZodTypeAny, {
full: string;
md?: string | undefined;
sm?: string | undefined;
cover?: boolean | undefined;
}, {
full: string;
md?: string | undefined;
sm?: string | undefined;
cover?: boolean | undefined;
}>, "many">>;
videos: z.ZodOptional<z.ZodArray<z.ZodObject<{
provider: z.ZodOptional<z.ZodString>;
id: z.ZodOptional<z.ZodString>;
embed_url: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
embed_url?: string | undefined;
provider?: string | undefined;
id?: string | undefined;
}, {
embed_url?: string | undefined;
provider?: string | undefined;
id?: string | undefined;
}>, "many">>;
virtual_tours: z.ZodOptional<z.ZodArray<z.ZodObject<{
embed_url: z.ZodString;
}, "strip", z.ZodTypeAny, {
embed_url: string;
}, {
embed_url: string;
}>, "many">>;
documents: z.ZodOptional<z.ZodArray<z.ZodObject<{
name: z.ZodString;
url: z.ZodString;
}, "strip", z.ZodTypeAny, {
name: string;
url: string;
}, {
name: string;
url: string;
}>, "many">>;
}, "strip", z.ZodTypeAny, {
images?: {
full: string;
md?: string | undefined;
sm?: string | undefined;
cover?: boolean | undefined;
}[] | undefined;
videos?: {
embed_url?: string | undefined;
provider?: string | undefined;
id?: string | undefined;
}[] | undefined;
virtual_tours?: {
embed_url: string;
}[] | undefined;
documents?: {
name: string;
url: string;
}[] | undefined;
}, {
images?: {
full: string;
md?: string | undefined;
sm?: string | undefined;
cover?: boolean | undefined;
}[] | undefined;
videos?: {
embed_url?: string | undefined;
provider?: string | undefined;
id?: string | undefined;
}[] | undefined;
virtual_tours?: {
embed_url: string;
}[] | undefined;
documents?: {
name: string;
url: string;
}[] | undefined;
}>;
declare const SettingsFormatSchema: z.ZodObject<{
currency_unit: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"BRL">, z.ZodLiteral<"USD">]>>;
area_unit: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"m2">, z.ZodLiteral<"ft2">]>>;
distance_unit: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"km">, z.ZodLiteral<"mi">, z.ZodLiteral<"meters">]>>;
exibir_no_mapa: z.ZodOptional<z.ZodBoolean>;
}, "strip", z.ZodTypeAny, {
currency_unit?: "BRL" | "USD" | undefined;
area_unit?: "m2" | "ft2" | undefined;
distance_unit?: "km" | "mi" | "meters" | undefined;
exibir_no_mapa?: boolean | undefined;
}, {
currency_unit?: "BRL" | "USD" | undefined;
area_unit?: "m2" | "ft2" | undefined;
distance_unit?: "km" | "mi" | "meters" | undefined;
exibir_no_mapa?: boolean | undefined;
}>;
declare const PropertyModelSchema: z.ZodObject<{
reference: z.ZodString;
title: z.ZodString;
description: z.ZodString;
media_assets: z.ZodObject<{
images: z.ZodOptional<z.ZodArray<z.ZodObject<{
full: z.ZodString;
md: z.ZodOptional<z.ZodString>;
sm: z.ZodOptional<z.ZodString>;
cover: z.ZodOptional<z.ZodBoolean>;
}, "strip", z.ZodTypeAny, {
full: string;
md?: string | undefined;
sm?: string | undefined;
cover?: boolean | undefined;
}, {
full: string;
md?: string | undefined;
sm?: string | undefined;
cover?: boolean | undefined;
}>, "many">>;
videos: z.ZodOptional<z.ZodArray<z.ZodObject<{
provider: z.ZodOptional<z.ZodString>;
id: z.ZodOptional<z.ZodString>;
embed_url: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
embed_url?: string | undefined;
provider?: string | undefined;
id?: string | undefined;
}, {
embed_url?: string | undefined;
provider?: string | undefined;
id?: string | undefined;
}>, "many">>;
virtual_tours: z.ZodOptional<z.ZodArray<z.ZodObject<{
embed_url: z.ZodString;
}, "strip", z.ZodTypeAny, {
embed_url: string;
}, {
embed_url: string;
}>, "many">>;
documents: z.ZodOptional<z.ZodArray<z.ZodObject<{
name: z.ZodString;
url: z.ZodString;
}, "strip", z.ZodTypeAny, {
name: string;
url: string;
}, {
name: string;
url: string;
}>, "many">>;
}, "strip", z.ZodTypeAny, {
images?: {
full: string;
md?: string | undefined;
sm?: string | undefined;
cover?: boolean | undefined;
}[] | undefined;
videos?: {
embed_url?: string | undefined;
provider?: string | undefined;
id?: string | undefined;
}[] | undefined;
virtual_tours?: {
embed_url: string;
}[] | undefined;
documents?: {
name: string;
url: string;
}[] | undefined;
}, {
images?: {
full: string;
md?: string | undefined;
sm?: string | undefined;
cover?: boolean | undefined;
}[] | undefined;
videos?: {
embed_url?: string | undefined;
provider?: string | undefined;
id?: string | undefined;
}[] | undefined;
virtual_tours?: {
embed_url: string;
}[] | undefined;
documents?: {
name: string;
url: string;
}[] | undefined;
}>;
attributes: z.ZodRecord<z.ZodString, z.ZodAny>;
settings: z.ZodOptional<z.ZodObject<{
currency_unit: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"BRL">, z.ZodLiteral<"USD">]>>;
area_unit: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"m2">, z.ZodLiteral<"ft2">]>>;
distance_unit: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"km">, z.ZodLiteral<"mi">, z.ZodLiteral<"meters">]>>;
exibir_no_mapa: z.ZodOptional<z.ZodBoolean>;
}, "strip", z.ZodTypeAny, {
currency_unit?: "BRL" | "USD" | undefined;
area_unit?: "m2" | "ft2" | undefined;
distance_unit?: "km" | "mi" | "meters" | undefined;
exibir_no_mapa?: boolean | undefined;
}, {
currency_unit?: "BRL" | "USD" | undefined;
area_unit?: "m2" | "ft2" | undefined;
distance_unit?: "km" | "mi" | "meters" | undefined;
exibir_no_mapa?: boolean | undefined;
}>>;
seo: z.ZodOptional<z.ZodObject<{
meta_title: z.ZodOptional<z.ZodString>;
meta_description: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
meta_title?: string | undefined;
meta_description?: string | undefined;
}, {
meta_title?: string | undefined;
meta_description?: string | undefined;
}>>;
updated_at: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
reference: string;
title: string;
description: string;
media_assets: {
images?: {
full: string;
md?: string | undefined;
sm?: string | undefined;
cover?: boolean | undefined;
}[] | undefined;
videos?: {
embed_url?: string | undefined;
provider?: string | undefined;
id?: string | undefined;
}[] | undefined;
virtual_tours?: {
embed_url: string;
}[] | undefined;
documents?: {
name: string;
url: string;
}[] | undefined;
};
attributes: Record<string, any>;
settings?: {
currency_unit?: "BRL" | "USD" | undefined;
area_unit?: "m2" | "ft2" | undefined;
distance_unit?: "km" | "mi" | "meters" | undefined;
exibir_no_mapa?: boolean | undefined;
} | undefined;
seo?: {
meta_title?: string | undefined;
meta_description?: string | undefined;
} | undefined;
updated_at?: string | undefined;
}, {
reference: string;
title: string;
description: string;
media_assets: {
images?: {
full: string;
md?: string | undefined;
sm?: string | undefined;
cover?: boolean | undefined;
}[] | undefined;
videos?: {
embed_url?: string | undefined;
provider?: string | undefined;
id?: string | undefined;
}[] | undefined;
virtual_tours?: {
embed_url: string;
}[] | undefined;
documents?: {
name: string;
url: string;
}[] | undefined;
};
attributes: Record<string, any>;
settings?: {
currency_unit?: "BRL" | "USD" | undefined;
area_unit?: "m2" | "ft2" | undefined;
distance_unit?: "km" | "mi" | "meters" | undefined;
exibir_no_mapa?: boolean | undefined;
} | undefined;
seo?: {
meta_title?: string | undefined;
meta_description?: string | undefined;
} | undefined;
updated_at?: string | undefined;
}>;
type ImageMedia = z.infer<typeof ImageMediaSchema>;
type VideoMedia = z.infer<typeof VideoMediaSchema>;
type DocumentMedia = z.infer<typeof DocumentMediaSchema>;
type VirtualTourMedia = z.infer<typeof VirtualTourMediaSchema>;
type MediaAssets = z.infer<typeof MediaAssetsSchema>;
type SettingsFormat = z.infer<typeof SettingsFormatSchema>;
type PropertyModel = z.infer<typeof PropertyModelSchema>;
declare const validatePropertyModel: (data: unknown) => PropertyModel;
declare const safeValidatePropertyModel: (data: unknown) => z.SafeParseReturnType<{
reference: string;
title: string;
description: string;
media_assets: {
images?: {
full: string;
md?: string | undefined;
sm?: string | undefined;
cover?: boolean | undefined;
}[] | undefined;
videos?: {
embed_url?: string | undefined;
provider?: string | undefined;
id?: string | undefined;
}[] | undefined;
virtual_tours?: {
embed_url: string;
}[] | undefined;
documents?: {
name: string;
url: string;
}[] | undefined;
};
attributes: Record<string, any>;
settings?: {
currency_unit?: "BRL" | "USD" | undefined;
area_unit?: "m2" | "ft2" | undefined;
distance_unit?: "km" | "mi" | "meters" | undefined;
exibir_no_mapa?: boolean | undefined;
} | undefined;
seo?: {
meta_title?: string | undefined;
meta_description?: string | undefined;
} | undefined;
updated_at?: string | undefined;
}, {
reference: string;
title: string;
description: string;
media_assets: {
images?: {
full: string;
md?: string | undefined;
sm?: string | undefined;
cover?: boolean | undefined;
}[] | undefined;
videos?: {
embed_url?: string | undefined;
provider?: string | undefined;
id?: string | undefined;
}[] | undefined;
virtual_tours?: {
embed_url: string;
}[] | undefined;
documents?: {
name: string;
url: string;
}[] | undefined;
};
attributes: Record<string, any>;
settings?: {
currency_unit?: "BRL" | "USD" | undefined;
area_unit?: "m2" | "ft2" | undefined;
distance_unit?: "km" | "mi" | "meters" | undefined;
exibir_no_mapa?: boolean | undefined;
} | undefined;
seo?: {
meta_title?: string | undefined;
meta_description?: string | undefined;
} | undefined;
updated_at?: string | undefined;
}>;
declare const AttributeSchema: z.ZodObject<{
key: z.ZodString;
value: z.ZodAny;
valueLabel: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
composedLabel: z.ZodOptional<z.ZodString>;
type: z.ZodOptional<z.ZodString>;
unit: z.ZodOptional<z.ZodString>;
format: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
key: string;
value?: any;
type?: string | undefined;
valueLabel?: string | string[] | undefined;
composedLabel?: string | undefined;
unit?: string | undefined;
format?: string | undefined;
}, {
key: string;
value?: any;
type?: string | undefined;
valueLabel?: string | string[] | undefined;
composedLabel?: string | undefined;
unit?: string | undefined;
format?: string | undefined;
}>;
type Attribute = z.infer<typeof AttributeSchema>;
type PropertyType = PropertyModel;
declare const PropertyTypeSchema: z.ZodObject<{
reference: z.ZodString;
title: z.ZodString;
description: z.ZodString;
media_assets: z.ZodObject<{
images: z.ZodOptional<z.ZodArray<z.ZodObject<{
full: z.ZodString;
md: z.ZodOptional<z.ZodString>;
sm: z.ZodOptional<z.ZodString>;
cover: z.ZodOptional<z.ZodBoolean>;
}, "strip", z.ZodTypeAny, {
full: string;
md?: string | undefined;
sm?: string | undefined;
cover?: boolean | undefined;
}, {
full: string;
md?: string | undefined;
sm?: string | undefined;
cover?: boolean | undefined;
}>, "many">>;
videos: z.ZodOptional<z.ZodArray<z.ZodObject<{
provider: z.ZodOptional<z.ZodString>;
id: z.ZodOptional<z.ZodString>;
embed_url: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
embed_url?: string | undefined;
provider?: string | undefined;
id?: string | undefined;
}, {
embed_url?: string | undefined;
provider?: string | undefined;
id?: string | undefined;
}>, "many">>;
virtual_tours: z.ZodOptional<z.ZodArray<z.ZodObject<{
embed_url: z.ZodString;
}, "strip", z.ZodTypeAny, {
embed_url: string;
}, {
embed_url: string;
}>, "many">>;
documents: z.ZodOptional<z.ZodArray<z.ZodObject<{
name: z.ZodString;
url: z.ZodString;
}, "strip", z.ZodTypeAny, {
name: string;
url: string;
}, {
name: string;
url: string;
}>, "many">>;
}, "strip", z.ZodTypeAny, {
images?: {
full: string;
md?: string | undefined;
sm?: string | undefined;
cover?: boolean | undefined;
}[] | undefined;
videos?: {
embed_url?: string | undefined;
provider?: string | undefined;
id?: string | undefined;
}[] | undefined;
virtual_tours?: {
embed_url: string;
}[] | undefined;
documents?: {
name: string;
url: string;
}[] | undefined;
}, {
images?: {
full: string;
md?: string | undefined;
sm?: string | undefined;
cover?: boolean | undefined;
}[] | undefined;
videos?: {
embed_url?: string | undefined;
provider?: string | undefined;
id?: string | undefined;
}[] | undefined;
virtual_tours?: {
embed_url: string;
}[] | undefined;
documents?: {
name: string;
url: string;
}[] | undefined;
}>;
attributes: z.ZodRecord<z.ZodString, z.ZodAny>;
settings: z.ZodOptional<z.ZodObject<{
currency_unit: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"BRL">, z.ZodLiteral<"USD">]>>;
area_unit: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"m2">, z.ZodLiteral<"ft2">]>>;
distance_unit: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"km">, z.ZodLiteral<"mi">, z.ZodLiteral<"meters">]>>;
exibir_no_mapa: z.ZodOptional<z.ZodBoolean>;
}, "strip", z.ZodTypeAny, {
currency_unit?: "BRL" | "USD" | undefined;
area_unit?: "m2" | "ft2" | undefined;
distance_unit?: "km" | "mi" | "meters" | undefined;
exibir_no_mapa?: boolean | undefined;
}, {
currency_unit?: "BRL" | "USD" | undefined;
area_unit?: "m2" | "ft2" | undefined;
distance_unit?: "km" | "mi" | "meters" | undefined;
exibir_no_mapa?: boolean | undefined;
}>>;
seo: z.ZodOptional<z.ZodObject<{
meta_title: z.ZodOptional<z.ZodString>;
meta_description: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
meta_title?: string | undefined;
meta_description?: string | undefined;
}, {
meta_title?: string | undefined;
meta_description?: string | undefined;
}>>;
updated_at: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
reference: string;
title: string;
description: string;
media_assets: {
images?: {
full: string;
md?: string | undefined;
sm?: string | undefined;
cover?: boolean | undefined;
}[] | undefined;
videos?: {
embed_url?: string | undefined;
provider?: string | undefined;
id?: string | undefined;
}[] | undefined;
virtual_tours?: {
embed_url: string;
}[] | undefined;
documents?: {
name: string;
url: string;
}[] | undefined;
};
attributes: Record<string, any>;
settings?: {
currency_unit?: "BRL" | "USD" | undefined;
area_unit?: "m2" | "ft2" | undefined;
distance_unit?: "km" | "mi" | "meters" | undefined;
exibir_no_mapa?: boolean | undefined;
} | undefined;
seo?: {
meta_title?: string | undefined;
meta_description?: string | undefined;
} | undefined;
updated_at?: string | undefined;
}, {
reference: string;
title: string;
description: string;
media_assets: {
images?: {
full: string;
md?: string | undefined;
sm?: string | undefined;
cover?: boolean | undefined;
}[] | undefined;
videos?: {
embed_url?: string | undefined;
provider?: string | undefined;
id?: string | undefined;
}[] | undefined;
virtual_tours?: {
embed_url: string;
}[] | undefined;
documents?: {
name: string;
url: string;
}[] | undefined;
};
attributes: Record<string, any>;
settings?: {
currency_unit?: "BRL" | "USD" | undefined;
area_unit?: "m2" | "ft2" | undefined;
distance_unit?: "km" | "mi" | "meters" | undefined;
exibir_no_mapa?: boolean | undefined;
} | undefined;
seo?: {
meta_title?: string | undefined;
meta_description?: string | undefined;
} | undefined;
updated_at?: string | undefined;
}>;
declare const validatePropertyType: (data: unknown) => PropertyModel;
declare const safeValidatePropertyType: (data: unknown) => z.SafeParseReturnType<{
reference: string;
title: string;
description: string;
media_assets: {
images?: {
full: string;
md?: string | undefined;
sm?: string | undefined;
cover?: boolean | undefined;
}[] | undefined;
videos?: {
embed_url?: string | undefined;
provider?: string | undefined;
id?: string | undefined;
}[] | undefined;
virtual_tours?: {
embed_url: string;
}[] | undefined;
documents?: {
name: string;
url: string;
}[] | undefined;
};
attributes: Record<string, any>;
settings?: {
currency_unit?: "BRL" | "USD" | undefined;
area_unit?: "m2" | "ft2" | undefined;
distance_unit?: "km" | "mi" | "meters" | undefined;
exibir_no_mapa?: boolean | undefined;
} | undefined;
seo?: {
meta_title?: string | undefined;
meta_description?: string | undefined;
} | undefined;
updated_at?: string | undefined;
}, {
reference: string;
title: string;
description: string;
media_assets: {
images?: {
full: string;
md?: string | undefined;
sm?: string | undefined;
cover?: boolean | undefined;
}[] | undefined;
videos?: {
embed_url?: string | undefined;
provider?: string | undefined;
id?: string | undefined;
}[] | undefined;
virtual_tours?: {
embed_url: string;
}[] | undefined;
documents?: {
name: string;
url: string;
}[] | undefined;
};
attributes: Record<string, any>;
settings?: {
currency_unit?: "BRL" | "USD" | undefined;
area_unit?: "m2" | "ft2" | undefined;
distance_unit?: "km" | "mi" | "meters" | undefined;
exibir_no_mapa?: boolean | undefined;
} | undefined;
seo?: {
meta_title?: string | undefined;
meta_description?: string | undefined;
} | undefined;
updated_at?: string | undefined;
}>;
declare const PropertyAttributesModel: ({
key: string;
label: string;
type: string;
cat: string;
order: number;
role?: undefined;
unit?: undefined;
composedLabel?: undefined;
iconName?: undefined;
} | {
key: string;
label: string;
type: string;
role: string;
unit: string;
cat: string;
order: number;
composedLabel?: undefined;
iconName?: undefined;
} | {
key: string;
label: string;
type: string;
role: string;
unit: string;
cat: string;
composedLabel: string;
order: number;
iconName?: undefined;
} | {
key: string;
label: string;
type: string;
role: string;
cat: string;
order: number;
unit?: undefined;
composedLabel?: undefined;
iconName?: undefined;
} | {
key: string;
label: string;
type: string;
role: string;
unit: string;
cat: string;
composedLabel: string;
iconName: string;
order: number;
} | {
key: string;
label: string;
type: string;
role: string;
cat: string;
composedLabel: string;
iconName: string;
order: number;
unit?: undefined;
})[];
declare const unitListModel: {
area: {
key: string;
aliases: string[];
label: string;
labelDisplay: string;
}[];
length: {
key: string;
aliases: string[];
label: string;
labelDisplay: string;
}[];
currency: {
key: string;
aliases: never[];
label: string;
labelDisplay: string;
locale: string;
}[];
};
declare const formatListModel: {
number: {
key: string;
label: string;
labelDisplay: string;
pattern: string;
}[];
currency: {
key: string;
label: string;
labelDisplay: string;
pattern: string;
}[];
date: {
key: string;
label: string;
labelDisplay: string;
pattern: string;
}[];
text: {
key: string;
label: string;
labelDisplay: string;
}[];
};
declare function verifyAttrKeyInPropertyV3Model(key: string): {
key: string;
label: string;
type: string;
cat: string;
order: number;
role?: undefined;
unit?: undefined;
composedLabel?: undefined;
iconName?: undefined;
} | {
key: string;
label: string;
type: string;
role: string;
unit: string;
cat: string;
order: number;
composedLabel?: undefined;
iconName?: undefined;
} | {
key: string;
label: string;
type: string;
role: string;
unit: string;
cat: string;
composedLabel: string;
order: number;
iconName?: undefined;
} | {
key: string;
label: string;
type: string;
role: string;
cat: string;
order: number;
unit?: undefined;
composedLabel?: undefined;
iconName?: undefined;
} | {
key: string;
label: string;
type: string;
role: string;
unit: string;
cat: string;
composedLabel: string;
iconName: string;
order: number;
} | {
key: string;
label: string;
type: string;
role: string;
cat: string;
composedLabel: string;
iconName: string;
order: number;
unit?: undefined;
} | undefined;
declare function mergePropertyAttributesModel(base: any[], overrides: any[]): any[];
declare function sortAttributes(attributes: any[], sortKeys?: string[]): any[];
declare const preparaAttrValueLabel: (valor: any) => any;
declare function generateFakeProperty(options?: {
tipo?: string;
exteriorPhotos?: number;
interiorPhotos?: number;
}): PropertyModel;
declare function generateFakeProperties(count?: number, options?: {
exteriorPhotos?: number;
interiorPhotos?: number;
tipos?: string[];
}): PropertyModel[];
declare function generateFakePropertyByType(tipo: string): PropertyModel | null;
declare function getAvailablePropertyTypes(): string[];
interface FieldConfig {
maxExamples?: number;
}
interface ProfilerConfig {
inputDir?: string;
inputData?: PropertyModel[];
outputDir?: string;
outputFileName?: string;
fieldConfigs?: Record<string, FieldConfig>;
defaultMaxExamples?: number;
verbose?: boolean;
}
type ProfileResult = Record<string, any[]>;
/**
* Serviço para fazer profiling (análise estatística) de dados PropertyModel
* Pode ser usado com dados de arquivos locais ou dados em memória
*/
declare class ProfilerService {
private config;
private fieldData;
private fieldExamples;
constructor(config: ProfilerConfig);
/**
* Executa o profiling dos dados
*/
profile(): Promise<ProfileResult>;
/**
* Carrega dados de arquivos ou usa dados fornecidos
*/
private loadData;
/**
* Processa os dados coletados e extrai informações estatísticas
*/
private processData;
/**
* Processa recursivamente um objeto para extrair todos os campos
*/
private processObject;
/**
* Adiciona um valor para um campo específico
*/
private addFieldValue;
/**
* Gera o resultado final do profiling
*/
private generateResult;
/**
* Salva o resultado em arquivo JSON
*/
private saveResult;
}
/**
* Função utilitária para fazer profiling rápido de dados em memória
*/
declare function profileProperties(properties: PropertyModel[], options?: Omit<ProfilerConfig, 'inputData'>): Promise<ProfileResult>;
/**
* Função utilitária para fazer profiling de arquivos
*/
declare function profileFromFiles(inputDir: string, options?: Omit<ProfilerConfig, 'inputDir'>): Promise<ProfileResult>;
interface ApiClientConfig {
endpoint: string;
headers?: Record<string, string>;
timeout?: number;
batchSize?: number;
}
/**
* Cliente simples para enviar dados PropertyModel para APIs externas
*/
declare class ApiClientService {
private config;
constructor(config: ApiClientConfig);
/**
* Envia uma propriedade para a API
*/
sendProperty(property: PropertyModel): Promise<boolean>;
/**
* Envia múltiplas propriedades
*/
sendProperties(properties: PropertyModel[]): Promise<void>;
/**
* Carrega propriedades de uma pasta com arquivos JSON
*/
sendPropertiesFromDir(inputDir: string): Promise<void>;
/**
* Carrega propriedades de arquivos JSON
*/
private loadPropertiesFromDir;
/**
* Envia propriedades em lotes
*/
private sendInBatches;
/**
* Divide array em lotes menores
*/
private createBatches;
/**
* Faz requisição HTTP para a API
*/
private makeHttpRequest;
}
interface CustomAction {
fn: string;
key: string;
value?: any;
type?: string;
label?: string;
}
interface AttributeRule {
key: string;
condition?: Record<string, any>;
rules: CustomAction[];
}
interface MapRules {
referenceRules?: Record<string, CustomAction[]>;
attributesRules?: AttributeRule[];
}
interface PropertyV3 {
id?: string;
reference?: string;
title?: string;
description?: string;
attributes: Record<string, any>;
[key: string]: any;
}
declare function PropertyCustomizer(property: PropertyV3, mapRules: MapRules): PropertyV3;
var $ref$1 = "#/definitions/PropertyModel";
var definitions$1 = {
PropertyModel: {
type: "object",
properties: {
reference: {
type: "string"
},
title: {
type: "string"
},
description: {
type: "string"
},
media_assets: {
type: "object",
properties: {
images: {
type: "array",
items: {
type: "object",
properties: {
full: {
type: "string"
},
md: {
type: "string"
},
sm: {
type: "string"
},
cover: {
type: "boolean"
}
},
required: [
"full"
],
additionalProperties: false
}
},
videos: {
type: "array",
items: {
type: "object",
properties: {
provider: {
type: "string"
},
id: {
type: "string"
},
embed_url: {
type: "string"
}
},
additionalProperties: false
}
},
virtual_tours: {
type: "array",
items: {
type: "object",
properties: {
embed_url: {
type: "string"
}
},
required: [
"embed_url"
],
additionalProperties: false
}
},
documents: {
type: "array",
items: {
type: "object",
properties: {
name: {
type: "string"
},
url: {
type: "string"
}
},
required: [
"name",
"url"
],
additionalProperties: false
}
}
},
additionalProperties: false
},
attributes: {
type: "object",
additionalProperties: {
}
},
settings: {
type: "object",
properties: {
currency_unit: {
type: "string",
"enum": [
"BRL",
"USD"
]
},
area_unit: {
type: "string",
"enum": [
"m2",
"ft2"
]
},
distance_unit: {
type: "string",
"enum": [
"km",
"mi",
"meters"
]
},
exibir_no_mapa: {
type: "boolean"
}
},
additionalProperties: false
},
updated_at: {
type: "string"
}
},
required: [
"reference",
"title",
"description",
"media_assets",
"attributes"
],
additionalProperties: false
}
};
var $schema$1 = "http://json-schema.org/draft-07/schema#";
var propertyModel = {
$ref: $ref$1,
definitions: definitions$1,
$schema: $schema$1
};
var $ref = "#/definitions/PropertyModel";
var definitions = {
PropertyModel: {
type: "object",
properties: {
reference: {
type: "string"
},
title: {
type: "string"
},
description: {
type: "string"
},
media_assets: {
type: "object",
properties: {
images: {
type: "array",
items: {
type: "object",
properties: {
full: {
type: "string"
},
md: {
type: "string"
},
sm: {
type: "string"
},
cover: {
type: "boolean"
}
},
required: [
"full"
],
additionalProperties: false
}
},
videos: {
type: "array",
items: {
type: "object",
properties: {
provider: {
type: "string"
},
id: {
type: "string"
},
embed_url: {
type: "string"
}
},
additionalProperties: false
}
},
virtual_tours: {
type: "array",
items: {
type: "object",
properties: {
embed_url: {
type: "string"
}
},
required: [
"embed_url"
],
additionalProperties: false
}
},
documents: {
type: "array",
items: {
type: "object",
properties: {
name: {
type: "string"
},
url: {
type: "string"
}
},
required: [
"name",
"url"
],
additionalProperties: false
}
}
},
additionalProperties: false
},
attributes: {
type: "object",
additionalProperties: {
}
},
settings: {
type: "object",
properties: {
currency_unit: {
type: "string",
"enum": [
"BRL",
"USD"
]
},
area_unit: {
type: "string",
"enum": [
"m2",
"ft2"
]
},
distance_unit: {
type: "string",
"enum": [
"km",
"mi",
"meters"
]
},
exibir_no_mapa: {
type: "boolean"
}
},
additionalProperties: false
},
updated_at: {
type: "string"
}
},
required: [
"reference",
"title",
"description",
"media_assets",
"attributes"
],
additionalProperties: false
}
};
var $schema = "http://json-schema.org/draft-07/schema#";
var propertyType_schema = {
$ref: $ref,
definitions: definitions,
$schema: $schema
};
export { type ApiClientConfig, ApiClientService, type Attribute, type AttributeRule, AttributeSchema, type CustomAction, type DocumentMedia, DocumentMediaSchema, type FieldConfig, type ImageMedia, ImageMediaSchema, type MapRules, type MediaAssets, MediaAssetsSchema, type ProfileResult, type ProfilerConfig, ProfilerService, PropertyAttributesModel, PropertyCustomizer, type PropertyModel, propertyModel as PropertyModelJsonSchema, PropertyModelSchema, type PropertyType, PropertyTypeSchema, propertyType_schema as PropertyTypeSchemaJson, type PropertyV3, type SettingsFormat, SettingsFormatSchema, type VideoMedia, VideoMediaSchema, type VirtualTourMedia, VirtualTourMediaSchema, formatListModel, generateFakeProperties, generateFakeProperty, generateFakePropertyByType, getAvailablePropertyTypes, mergePropertyAttributesModel, preparaAttrValueLabel, profileFromFiles, profileProperties, safeValidatePropertyModel, safeValidatePropertyType, sortAttributes, unitListModel, validatePropertyModel, validatePropertyType, verifyAttrKeyInPropertyV3Model };