0.6.0 • Published 11 months ago

@izzle-org/crud-io v0.6.0

Weekly downloads
4
License
MIT
Repository
github
Last release
11 months ago

Izzle Crud IO JS Lib

Simple Crud Service Lib, based on OAuth2 Authorization and Axios Calls

Installation

Using npm:

$ npm i -g npm
$ npm i @izzle-org/crud-io

Usage

My Crud Service 'product.service.js'

import { CrudService } from '@izzle-org/crud-io'

export default class extends CrudService { constructor () { super('products') } }

> index.js
```js
import { ApiService, JwtService } from '@izzle-org/crud-io'

// Handle OAuth2
...
// JWT Config
JwtService.encrypt = true
JwtService.secretKey = 'foobar123'
JwtService.useSessionStorage()

JwtService.setToken({ access_token: 'foobar' })

// API Config
ApiService.init('https://api.foo.bar')
ApiService.setAuthHeader('Bearer ' + JwtService.getToken().access_token)

import ProductService from './product.service.js'

const service = new ProductService()

// GET https://api.foo.bar/products with Authorization Header (Bearer foobar)
let products = service.list()

License

Copyright (c) 2020-present Daniel Böhmer

MIT License

0.6.0

11 months ago

0.5.0

2 years ago

0.4.5

3 years ago

0.4.4

3 years ago

0.4.6

3 years ago

0.4.3

3 years ago

0.4.2

3 years ago

0.4.1

3 years ago

0.4.0

3 years ago

0.3.10

4 years ago

0.3.9

4 years ago

0.3.8

4 years ago

0.3.7

4 years ago

0.3.6

4 years ago

0.3.5

4 years ago

0.3.4

4 years ago