# @nowasterio/js-client

> The backend API for the NoWaster App

Latest version **1.0.0** (published 2023-04-28) · Unlicense license · 0 weekly downloads

## Install

```sh
npm install @nowasterio/js-client
pnpm add @nowasterio/js-client
yarn add @nowasterio/js-client
bun add @nowasterio/js-client
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2023-04-28 |
| First published | 2023-04-28 |
| Weekly downloads | 0 |
| License | Unlicense |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 222.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | nowaster-dev |

## Links

- npm: https://www.npmjs.com/package/@nowasterio/js-client
- npm.io page: https://npm.io/package/@nowasterio/js-client

## Dependencies (2)

- [@babel/cli](https://npm.io/package/@babel/cli.md) ^7.0.0
- [superagent](https://npm.io/package/superagent.md) ^5.3.0

## Recent versions

- 1.0.0 (latest) — 2023-04-28

## README

# @nowasterio/js-client

@nowasterio/ts-client - JavaScript client for @nowasterio/js-client
The backend API for the NoWaster App
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: 1.0
- Package version: 1.0.0
- Build package: org.openapitools.codegen.languages.JavascriptClientCodegen

## Installation

### For [Node.js](https://nodejs.org/)

#### npm

To publish the library as a [npm](https://www.npmjs.com/), please follow the procedure in ["Publishing npm packages"](https://docs.npmjs.com/getting-started/publishing-npm-packages).

Then install it via:

```shell
npm install @nowasterio/js-client --save
```

Finally, you need to build the module:

```shell
npm run build
```

##### Local development

To use the library locally without publishing to a remote npm registry, first install the dependencies by changing into the directory containing `package.json` (and this README). Let's call this `JAVASCRIPT_CLIENT_DIR`. Then run:

```shell
npm install
```

Next, [link](https://docs.npmjs.com/cli/link) it globally in npm with the following, also from `JAVASCRIPT_CLIENT_DIR`:

```shell
npm link
```

To use the link you just defined in your project, switch to the directory you want to use your @nowasterio/js-client from, and run:

```shell
npm link /path/to/<JAVASCRIPT_CLIENT_DIR>
```

Finally, you need to build the module:

```shell
npm run build
```

#### git

If the library is hosted at a git repository, e.g.https://github.com/nowaster/ts-client
then install it via:

```shell
    npm install nowaster/ts-client --save
```

### For browser

The library also works in the browser environment via npm and [browserify](http://browserify.org/). After following
the above steps with Node.js and installing browserify with `npm install -g browserify`,
perform the following (assuming *main.js* is your entry file):

```shell
browserify main.js > bundle.js
```

Then include *bundle.js* in the HTML pages.

### Webpack Configuration

Using Webpack you may encounter the following error: "Module not found: Error:
Cannot resolve module", most certainly you should disable AMD loader. Add/merge
the following section to your webpack config:

```javascript
module: {
  rules: [
    {
      parser: {
        amd: false
      }
    }
  ]
}
```

## Getting Started

Please follow the [installation](#installation) instruction and execute the following JS code:

```javascript
var @nowasterio/ts-client = require('@nowasterio/js-client');


var api = new @nowasterio/ts-client.AdminApi()
var opts = {
  'createDrinkRequest': {"id":"a","name":"brad","ingredients":[],"alcohol_percentage":0.1,"address":"addr","weight":10,"price":100,"type":1,"menu_id":"cfbs9a07t2ulhusqili0","efficiency":0.1,"eco_points":0.1} // {CreateDrinkRequest} 
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.createDrink(opts, callback);

```

## Documentation for API Endpoints

All URIs are relative to *http://localhost:8080*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*@nowasterio/ts-client.AdminApi* | [**createDrink**](docs/AdminApi.md#createDrink) | **POST** /admin/drinks | Create Drink
*@nowasterio/ts-client.AdminApi* | [**postAdminPlaces**](docs/AdminApi.md#postAdminPlaces) | **POST** /admin/places | Create Place
*@nowasterio/ts-client.UserApi* | [**getAlcoholContentSlug**](docs/UserApi.md#getAlcoholContentSlug) | **GET** /alcohol_content/{slug} | Get Alcohol Content for drink slug
*@nowasterio/ts-client.UserApi* | [**listPlaces**](docs/UserApi.md#listPlaces) | **GET** /places | List all places
*@nowasterio/ts-client.UserApi* | [**nowastifyDrinks**](docs/UserApi.md#nowastifyDrinks) | **GET** /places/drinks/nowastify | Nowastify Drinks
*@nowasterio/ts-client.UserApi* | [**postAutocomplete**](docs/UserApi.md#postAutocomplete) | **POST** /autocomplete | List Autocomplete Suggestions


## Documentation for Models

 - [@nowasterio/ts-client.CreateDrinkRequest](docs/CreateDrinkRequest.md)
 - [@nowasterio/ts-client.Drink](docs/Drink.md)
 - [@nowasterio/ts-client.DrinkWithAmount](docs/DrinkWithAmount.md)
 - [@nowasterio/ts-client.GetAlcoholContentSlug200Response](docs/GetAlcoholContentSlug200Response.md)
 - [@nowasterio/ts-client.Menu](docs/Menu.md)
 - [@nowasterio/ts-client.NowastifyDrinks200Response](docs/NowastifyDrinks200Response.md)
 - [@nowasterio/ts-client.Place](docs/Place.md)
 - [@nowasterio/ts-client.PlaceGeolocation](docs/PlaceGeolocation.md)
 - [@nowasterio/ts-client.PlaceOpenHours](docs/PlaceOpenHours.md)
 - [@nowasterio/ts-client.PlaceOpenHoursInterval](docs/PlaceOpenHoursInterval.md)
 - [@nowasterio/ts-client.PostAdminPlacesRequest](docs/PostAdminPlacesRequest.md)
 - [@nowasterio/ts-client.PostAutocomplete200Response](docs/PostAutocomplete200Response.md)
 - [@nowasterio/ts-client.PostAutocomplete200ResponseSuggestionsInner](docs/PostAutocomplete200ResponseSuggestionsInner.md)
 - [@nowasterio/ts-client.PostAutocompleteRequest](docs/PostAutocompleteRequest.md)


## Documentation for Authorization



### http-basic

- **Type**: HTTP basic authentication

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