# @inclouded/lavinia-sdk

> ## Bevezető

Latest version **1.0.0** (published 2020-05-12) · 0 weekly downloads

## Install

```sh
npm install @inclouded/lavinia-sdk
pnpm add @inclouded/lavinia-sdk
yarn add @inclouded/lavinia-sdk
bun add @inclouded/lavinia-sdk
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2020-05-12 |
| First published | 2020-05-12 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 145.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | grindy, jankiz, m2m-deploy, bilickiv |

## Links

- npm: https://www.npmjs.com/package/@inclouded/lavinia-sdk
- npm.io page: https://npm.io/package/@inclouded/lavinia-sdk

## Dependencies (1)

- [tslib](https://npm.io/package/tslib.md) ^1.9.0

## Recent versions

- 1.0.0 (latest) — 2020-05-12

## README

# Lavinia Api SDK

## Bevezető

A repository-ban az LaviniaApi SDK található egy telepíthető Angular könyvtár formájában. Az SDK telepíthető minden Angular 2+ projekthez. Az SDK megvalósítja a szükséges CRUD műveleteket.

## Használata

1. Az SDK használatához szükséges egy Angular 2+ projekt.

2. A hozzá kapcsolódó interface-ek (User.ts, Device.ts, LaviniaDAO.ts):

```typescript
export class User {
    _id: string;
    className: string;
    email: string;
    fullname: string;
    active: boolean;
    comment: string;
    password: string;
    type: string;
}

export class Device {
    _id: string;
    className: string;
    name: string;
    description: string;
    owner: string;
    hwId: string;
    acls: string;
}

export interface LaviniaDAO {
    httpClient: HttpClient;
    url: string;
}

export enum ClassName {
    user = 'model.User',
    device = 'model.Device',
}

export enum UserType {
    admin = 'admin',
    user = 'user'
}
```

3. Egy Service-ben felhasználható az SDK, az alábbi módon:

```javascript
import { Injectable } from '@angular/core';
import { LaviniaApi, documentType, LaviniaDAO } from '@inclouded/lavinia-sdk';
import { HttpClient } from '@angular/common/http';

@Injectable()
export class LaviniaApiService {

  LaviniaApi: LaviniaApi;
  LaviniaDAO: LaviniaDAO = {
   httpClient: this.http,
   url: 'https://url.hu'
  };
  collectionName = 'collectionName';
  documentType = documentType;

  constructor(private http: HttpClient) {
    this.LaviniaApi = new LaviniaApi(this.LaviniaDAO, this.collectionName, this.documentType);
  }

  add(data: any) {
    return this.LaviniaApi.add(data);
  }

  delete(id: string) {
    return this.LaviniaApi.delete(id);
  }

  update(data: any, id: string) {
    return this.LaviniaApi.delete(data, id);
  }
}

```

Felelős fejlesztő: Simon Gábor (simonovszkij@gmail.com)

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