New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@foyer-inc/api-sdk

Package Overview
Dependencies
Maintainers
4
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@foyer-inc/api-sdk

TypeScript SDK for interacting with Foyer API services.

  • 1.6.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
4
Created
Source

Foyer API

npm MIT License

Additional documentation at Docs

Additional details on filter structure available at Sequelize

Listed below is example usage of the Foyer api-sdk

import { OpenAPI, PropertyService } from '@foyer-inc/api-sdk';

//usually will not need to change this but it is available for redirecting requests away from the main production api
OpenAPI.BASE = 'remote api endpoint';

//use auth token from Okta or from UserService.login
//needed to access protected endpoints
//set statically and globally
OpenAPI.TOKEN = 'token';

//use await/async  or Promise callback
const properties = await PropertyService.getProperties();

PropertyService.getProperties().then((value) => console.log(value));

//Typically used with a filter to specify which Properties to return
//The filter is also used to indicate which related models should also be returned

const filter = {
  // For more granularity, all fields on Property are able to be included as search criteria.
  where: {
    BedroomsTotal: 2
    BathroomsTotalInteger: {
      gt: 2
    }
  },
  //an array of column names to return. helpful to limit returning unnecessary information
  attributes: ["ListingKey", "StreetNumber"],
  //an array of associated models to return,
  //elements in this array can also be narrowed by including a similarly structured filter
  include: [
    { association: "Media" }
  ],
  // an integer for how many entries to return
  limit: 10,
  // an integer for how many entries to skip, useful for pagination
  offset: 10,
};

const properties = await PropertyService.getProperties(JSON.stringify(filter));
//example usage with verbosity param instead of filter object
PropertyService.getProperties(undefined, 'card').then((value) =>
  console.log(value)
);

RESO Available Foyer models comply with RESO Spec

See RESO Data Dictionary for a comprehensive look at RESO

See Reference Worksheet for Standard Relationships

FAQs

Package last updated on 23 Nov 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc