# ggizmo-api

> Gizmo SDK APIv2

Latest version **0.1.1** (published 2021-04-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install ggizmo-api
pnpm add ggizmo-api
yarn add ggizmo-api
bun add ggizmo-api
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2021-04-30 |
| First published | 2021-04-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 112.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | KeZA3D |
| Maintainers | keza3d |
| Keywords | GizmoAPI, GizmoSDK, Gizmo, Gizmopowered |

## Links

- npm: https://www.npmjs.com/package/ggizmo-api
- Repository: https://github.com/KeZA3D/ggizmo-api
- Homepage: https://github.com/KeZA3D/ggizmo-api.git#readme
- Issues: https://github.com/KeZA3D/ggizmo-api.git/issues
- npm.io page: https://npm.io/package/ggizmo-api

## Dependencies (2)

- [node-fetch](https://npm.io/package/node-fetch.md) ^2.6.1
- [querystring](https://npm.io/package/querystring.md) ^0.2.1

## Recent versions

- 0.1.1 (latest) — 2021-04-30
- 0.1.0 — 2021-04-30
- 0.0.9 — 2021-04-30
- 0.0.8 — 2021-04-30
- 0.0.7 — 2021-04-30
- 0.0.6 — 2021-04-27
- 0.0.5 — 2021-04-27
- 0.0.4 — 2021-04-27
- 0.0.3 — 2021-04-27
- 0.0.2 — 2021-04-27
- 0.0.1 — 2021-04-27

## README

# node-gizmo-api
Gizmo API Library for Node.js (NOT OFFICIAL) 

![GCGApp](https://ggbook.ru/AdminPanel/public/images/favicon-32x32.png)
[![Build Status](https://travis-ci.org/joemccann/dillinger.svg?branch=master)](https://travis-ci.org/keza3d/ggizmo-api)

## Installation
Read Gizmo API Documentation - [link](http://cloud.gizmopowered.net/doc/index.html)
```bash
npm install ggizmo-api
```

## Quick Example
```js
const api = require('ggizmo-api')

async () => {
    try {
        // Make sure you have the correct port open and the web portal enabled in the settings.
        // Enable Bearer | Basic token use True | False
        const con = new api(true, {
            host: "localhost",
            port: 80,
            ssl: false,
            username: 'admin',
            password: 'admin'
        });
        
        //Generate new Token
        await con.createToken()
        
        //Using APIv2
        const v2 = con.v2()
        
        //Simple Fetch query
        const test = await v2.UserGroups.Get()
        const data = await test.json()
        
        console.log(data)
    } catch (err) {
        // ... http error checks
    }
}
```

## Commands
All commands are identical to the requests that are specified in your server documentation (http: //localhost/doc/index.html)
Example:
```
APIv2 => UserGroups => GET QUERY = v2().UserGroups.Get(Options)
```
Here we use the GET request of the Usergroup

### Available Commands
 - AppCategories
 - AppDeployments
 - AppEnterprises
 - AppExecutables
 - AppGroups
 - AppLicenses
 - AppPersonalFiles
 - Apps
 - AppTasks
 - Assets
 - AssetTransactions
 - AssetTypes
 - Attributes
 - BillingProfiles
 - DepositTransactions
 - HostGroups
 - HostIcons
 - Hosts
 - InvoicePayments
 - Invoices
 - MonetaryUnits
 - Operators
 - PaymentMethods
 - ProductGroups
 - Products
 - ProductsStock
 - Registers
 - RegisterTransactions
 - Reservations
 - SalePresets
 - StockTransactions
 - Taxes
 - UserGroups
 - Users
 - Variables 

## Token
You can use Basic authorization or Bearer
```
const init = new api(true, { username:'admin',password:'admin' })
await init.createToken()
//Authorization: Bearer Generated Token

const init = new api(false, { username:'admin',password:'admin' })
//Authorization: Basic base64(username:password)
```
Also, if you already have a Token, you can specify it during initialization.
```
const init = new api(true, { token: '{TOKEN}' })
```

## License
GGizmo-API is released under the [MIT License](https://github.com/KeZA3D/ggizmo-api/blob/main/LICENSE)

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