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

@heseya/store-core

Package Overview
Dependencies
Maintainers
1
Versions
322
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@heseya/store-core

[![Coverage](https://gitlab.com/heseya/heseya-store-core/badges/develop/coverage.svg)](https://gitlab.com/heseya/heseya-store-core/-/graphs/develop/charts) [![Coverage](https://gitlab.com/heseya/heseya-store-core/badges/develop/pipeline.svg)](https://gitl

  • 2.3.0-beta.5
  • npm
  • Socket score

Version published
Weekly downloads
142
increased by52.69%
Maintainers
1
Weekly downloads
 
Created
Source

@heseya/store-core

Coverage Coverage

Instalation

$ yarn add @heseya/store-core
// or
$ npm i @heseya/store-core

Usage

Heseya Api Service

Initialization

You can create the Heseya Api Service using the factory method.

import { createHeseyaApiService } from '@heseya/store-core'

const heseya = createHeseyaApiService(axios)

You need to pass the axios instance to the factory method. This allows you to modify axios instance to your needs. For example you can add a custom header to the request or implement a custom interceptor. Remember to pass the BaseUrl to the axios instance!

Example of the simple axios instance:

import axios from 'axios'

const instance = axios.create({
  baseURL: 'https://api.heseya.com',
  headers: {
    'X-Custom-Header': 'Custom Value',
  },
})
Initialization in Nuxt.js

In nuxt, you can inject the service into the context. This allows you to use the service in your components. To do this you need to create the following plugin:

import { Plugin } from '@nuxt/types'
import { createHeseyaApiService } from '@heseya/store-core'

const heseyaPlugin: Plugin = ({ $axios }, inject) => {
  inject('heseya', createHeseyaApiService($axios))
}

export default heseyaPlugin
Usage

After creating the instance, you can use the service as you wish. Below are usage examples. Every method in the service is fully typed and documented.

heseya.Products.get({ search: 'test' }) // Returns the products that was found by the search term
heseya.Orders.getOneByCode('ORDERCODE') // Returns the order summary with the given code

Others

TODO

FAQs

Package last updated on 31 Mar 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