# ss-hiboutik-sdk-js

> Hiboutik querries and mock library for SilverStock apps

Latest version **1.0.1** (published 2023-12-18) · ISC license · 0 weekly downloads

## Install

```sh
npm install ss-hiboutik-sdk-js
pnpm add ss-hiboutik-sdk-js
yarn add ss-hiboutik-sdk-js
bun add ss-hiboutik-sdk-js
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2023-12-18 |
| First published | 2023-12-18 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 5 |
| Unpacked size | 51.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Alan Thomas |
| Maintainers | altho |

## Links

- npm: https://www.npmjs.com/package/ss-hiboutik-sdk-js
- npm.io page: https://npm.io/package/ss-hiboutik-sdk-js

## Dependencies (5)

- [ky](https://npm.io/package/ky.md) ^1.1.3
- [chai](https://npm.io/package/chai.md) *
- [dayjs](https://npm.io/package/dayjs.md) ^1.11.10
- [mocha](https://npm.io/package/mocha.md) *
- [@renyuneyun/parse-link-header-ts](https://npm.io/package/@renyuneyun/parse-link-header-ts.md) ^1.0.1

## Recent versions

- 1.0.1 (latest) — 2023-12-18
- 1.0.0 — 2023-12-18

## README

## hiboutik-mock

Librairie de mock pour API hiboutik.

### Initialisation :

```ts
import { HiboutikMock } from '@silversmok/hiboutik-mock';

const hiboutikMock = new HiboutikMock();
```
---
### Generation des ventes :

```ts
const sales = hiboutikMock.fetchSales(storeId: number, year: number, month: number, day?: number);
```
Retourne :
```ts
Promise<HiboutikSale[]>
```

```fetchSales``` retourne un tableau de ventes pour la date donnée. Si ```day``` n'est pas renseigné, retourne les ventes du mois.


---

### Generation des produits :

```ts
const products = hiboutikMock.getProducts(storeId: number);
```
Retourne :
```ts
Promise<HiboutikProduct[]>
```

```getProducts``` retourne un tableau de produits pour le magasin donné.

> [!WARNING]  
> Les ventes doivent etre générées dans l'instance avant les produits.

---


### Generation des stores :

```ts
const stores = hiboutikMock.getStores();
```
Retourne :
```ts
Promise<HiboutikStore[]>
```

```getStores``` retourne un tableau de magasins.

---

### Generation de la première vente :

```ts
const firstSale = hiboutikMock.getFirstSale(storeId: number);
```
Retourne :
```ts
Promise<HiboutikSale[]>
```

```getFirstSale``` retourne la première vente du magasin donné.

---
_Source: https://npm.io/package/ss-hiboutik-sdk-js · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
