@gokiteam/uac
v0.3.79
Published
Universal Api Cunsumer for Goki Services
Downloads
14
Keywords
Readme
Goki Universal API Consumer
Universal API consumer for the Goki web service.
Goal
The goal of this project is to provide an easy to use and powerful interface for working with the Goki web service.
Requirements
- Any of the following JavaScript runtime environments: Node, Browser, etc.
- Axios
- react-query v4
- Typescript
Installation
To install Goki UAC using NPM run the following command:
$ npm i @gokiteam/uac
or
$ yarn add @gokiteam/uac
Services
- accountTransactions,
- apiKeys
- auth
- automations
- balances
- boards
- common
- conversations
- hostels
- icCards
- integrations
- invoices
- mails
- messages
- notes
- payouts
- reservations
- search
- settings
- shoutouts
- spaces
- subscriptions
- travelers
- dataReports
- staffs
- gateways
- images
- locks
- members
- payableItems
- payments
- permissionGroups
- reservationKeyChains
- todos
Usage
Import Goki UAC in your code.
ES6:
import { api } from '@gokiteam/uac';
alternatively you can import only the services you need:
import spaces from '@gokiteam/uac/dist/io/spaces';
Call any of the functions provided by the different services in Goki UAC.
- react-query for get data from API
const { data, refetch, isLoading, isFetching, isSuccess } =
api.spaces.useGetSpaces(params);
- POST, PATCH and Delete methods is implemented based on the services
const newConfigs = { roomSortType: 'name' };
api.staff.updateMySettings({ uiConfigs: newConfigs });
Todo
- [ ] use react-query mutation for updating and creating on services (improve performance a lot)