New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@noonahq/noona-api

Package Overview
Dependencies
Maintainers
7
Versions
162
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

@noonahq/noona-api

This client uses [Orval](https://orval.com) to generate the client from noona-api's OpenAPI spec. It both exports Typescript interfaces and creates [React Query](https://react-query.tanstack.com) wrappers as well.

unpublished
latest
npmnpm
Version
0.0.293
Version published
Maintainers
7
Created
Source

Noona Typescript Client

This client uses Orval to generate the client from noona-api's OpenAPI spec. It both exports Typescript interfaces and creates React Query wrappers as well.


Installation

yarn

yarn add @noonahq/noona-api react-query

npm

(meteor) npm install --save @noonahq/noona-api react-query

Install/update w.r.t. specific tag/branch

For each branch in the noona-api project, a NPM tag is published with it.

Example to install the package that correlates with the dev branch, use

yarn add @noonahq/noona-api@dev

Setup

Configure axios

import axios from "axios";

axios.interceptors.request.use(async (config) => {
  const newConfig: AxiosRequestConfig = {
    ...config,
    baseURL: "https://api.noona.is",
    headers: {
      // Use HQ-ACCESS-KEY if Tímatal
      "NOONA-ACCESS-KEY": "XXX",
    },
  };

  return newConfig;
});

📘 The client package itself doesn't install axios. This is due to the fact that if the client also has axios installed, two instances are present and thus configuring it in your client won't work.


Configure react-query

Follow the quick start chapter in React Query's documentation, creating a QueryClient instance and wrap a QueryClientProvider around your application.

📘 Meteor + React + Blaze creates a new ReactDOM.render instance, resulting in Context values not being drilled down the DOM tree properly. The author of the library suggests wrapping every "level 3" React component with the provider - in our case, ReactQueryProvider. See the link for more details.


Usage

Interfaces

import { Company } from "@noonahq/noona-api";

Queries

import { useListCompanies } from "@noonahq/noona-api";

const { data, isLoading } = useListCompanies({
  company_type_id: companyTypeId,
  geolocation: {
    lat: location?.latLng?.lat ?? 0,
    lng: location?.latLng?.lng ?? 0,
  },
  sort_by: "popular",
});

const companies = data?.data;

FAQs

Package last updated on 11 Jan 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