npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@horizon-integrations/publisher-crm

v2.0.18

Published

Integração da Imobland Horizon com a Publisher CRM

Readme

@horizon-integrations/publisher-crm

Integração da Imobland Horizon com a Publisher CRM. Converte dados de imóveis do formato Publisher para o formato Horizon Property V3.

Instalação

npm install @horizon-integrations/publisher-crm
# ou
pnpm add @horizon-integrations/publisher-crm

Uso Básico

import {
  convertPublisherToHorizonV3,
  PublisherPropertySchema,
  HorizonPropertySchemaByPublisherZod,
} from "@horizon-integrations/publisher-crm"

// Dados vindos da API Publisher
const publisherData = {
  reference: "PUB-001",
  title: "Apartamento 3 quartos Centro",
  description: "Lindo apartamento com vista",
  model: "Apartamento",
  type: "Padrão",
  operation: "sale",
  values: {
    bedrooms: 3,
    suites: 1,
    bathrooms: 2,
    garage: 2,
    "total-area": 120.5,
    pool: true,
    elevator: true,
    "accepts-financing": true,
  },
  media: {
    pictures: [...],
    videos: [...],
    tour360: [...],
  },
  agent: {
    id: "123",
    name: "João Silva",
  },
  tags: ["destaque", "novo"],
  updated_at: "2025-11-16T10:00:00.000Z",
}

// Validar entrada (opcional)
const validatedInput = PublisherPropertySchemaZod.parse(publisherData)

// Converter para formato Horizon
const horizonProperty = convertPublisherPropertyToHorizon(validatedInput)

// Validar saída (opcional)
const validatedOutput = HorizonPropertySchemaByPublisherZod.parse(horizonProperty)

Estrutura de Dados

Entrada (Publisher)

{
  reference: string           // Código de referência
  title: string               // Título do anúncio
  description: string         // Descrição
  model: string               // Modelo (ex: "Apartamento", "Casa")
  type: string                // Tipo (ex: "Padrão", "Sobrado")
  operation: string           // Operação: "sale" | "rent" | "season"
  values: {                   // Atributos do imóvel
    bedrooms: number
    suites: number
    bathrooms: number
    garage: number
    "total-area": number
    pool: boolean
    elevator: boolean
    "accepts-financing": boolean
    // ... 140+ campos
  }
  media: {
    pictures: Picture[]
    videos: Video[]
    tour360: Tour360[]
  }
  agent?: {
    id: string | number
    name: string
  }
  tags: string[] | string
  updated_at: string
}

Saída (Horizon Property V3)

76 campos no total:

  • 54 campos base (padrão Horizon)
  • 22 campos estendidos (específicos Publisher)
{
  // Identificação
  reference: string
  title: string
  description: string
  tipo: string              // model → tipo
  subtipo: string           // type → subtipo
  operacao: string[]        // ["venda"] | ["locacao"] | ["temporada"]

  // Áreas
  area_total: number
  area_privativa: number
  area_util: number
  area_construida: number   // campo estendido

  // Dependências
  dormitorios: number
  suites: number
  banheiros: number
  vagas_garagem: number

  // Localização
  endereco_cep: string
  endereco_estado: string
  endereco_cidade: string
  endereco_bairro: string
  endereco_logradouro: string
  endereco_numero: string
  latitude: number
  longitude: number

  // Valores
  valor_iptu: number
  valor_condominio: number
  valor_seguro_incendio: number  // campo estendido
  valor_pcf: number              // campo estendido

  // Características (array de strings)
  caracteristicas: string[]      // piscina, elevador, churrasqueira, etc.

  // Situações legais/burocráticas (array de strings)
  situacoes: string[]            // aceita_financiamento, vendido, averbado, etc.

  // Estrutura (campos estendidos)
  andar: number
  andares: number
  tipo_piso: string
  tipo_teto: string
  tipo_pintura: string
  tipo_material: string
  tipo_esquadrias: string
  ano_construcao: number
  status_imovel: string

  // Terreno (campos estendidos)
  terreno_solo: string
  terreno_nivel: string
  terreno_cercado: string
  terreno_vegetacao: string
  orientacao_solar: string

  // Rural (campos estendidos)
  rural_hectares: number
  rural_alqueires: number

  // Mídia
  images: Image[]
  videos: Video[]
  virtual_tours: Tour[]
  main_image: Image

  // Corretor
  corretor_key: string
  corretor_nome: string

  // ... e mais
}

Mapeamento de Campos

Tipo e Subtipo

  • modeltipo (categoria principal: Apartamento, Casa, Terreno)
  • typesubtipo (subcategoria: Padrão, Sobrado, Cobertura)

Operação

  • sale["venda"]
  • rent["locacao"]
  • season["temporada"]

Booleanos Físicos → caracteristicas[]

Booleanos como pool, elevator, barbecue, sauna, etc. são convertidos para strings no array caracteristicas:

// Entrada
{ pool: true, elevator: true, barbecue: true }

// Saída
{ caracteristicas: ["piscina", "elevador", "churrasqueira"] }

Booleanos Legais → situacoes[]

Booleanos como accepts-financing, sold, averbado, etc. são convertidos para strings no array situacoes:

// Entrada
{ "accepts-financing": true, averbado: true, sold: false }

// Saída
{ situacoes: ["aceita_financiamento", "averbado"] }

Endereço

  • city: "Ponta Grossa - PR"endereco_cidade: "Ponta Grossa", endereco_estado: "PR"
  • geo-position: "-25.09, -50.16"latitude: -25.09, longitude: -50.16

Scripts

# Build
pnpm build

# Verificar tipos
pnpm typecheck

# Executar testes
pnpm test

# Gerar schema Zod (após modificar schema TypeScript)
pnpm generate:zod

Exports

// Função de conversão
export { convertPublisherPropertyToHorizon }

// Schema TypeScript (SSOT)
export { HorizonPropertySchemaByPublisher }

// Schemas Zod
export { PublisherPropertySchemaZod, type PublisherPropertySchemaType }
export { HorizonPropertySchemaByPublisherZod, type HorizonPropertySchemaByPublisherType }

Dependências

  • @horizon-domains/property-model: ^3.9.9
  • zod: ^3.25.67

Licença

MIT