Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@izzle-org/crud-io

izzle-org40MIT0.6.0

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

Izzle, Crud

readme

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' `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

changelog

CHANGELOG

This changelog references the relevant changes (bug and security fixes)

  • 0.5.0 (2022-03-17)

    • change [ApiService] Changed setHeaders object merging
    • feature [JwtService] Added Memory Storage
  • 0.4.6 (2021-07-07)

    • feature [ApiService] Added additional init param to control the axios withCredentials option
  • 0.4.5 (2021-07-06)

    • fix [JwtService] Minor getToken fix
  • 0.4.4 (2021-07-06)

    • fix [JwtService] Minor setToken fix
  • 0.4.3 (2021-07-05)

    • fix [JwtService] Minor setter fix
  • 0.4.2 (2021-07-05)

    • feature [JwtService] JWT can now be encrypted
    • feature [JwtService] JWT can now be saved to local or session Storage
  • 0.4.1 (2021-02-02)

    • change [ApiService] Added withCredentials config value to true
    • change [Package] Push to new Axios Version
  • 0.4.0 (2020-11-19)

    • feature [JwtService] Added exceptions to verify method
    • feature [JwtService] Added a 5 minutes clock tolerance to verification
  • 0.3.10 (2020-11-09)

    • bug [ApiService] Fixed minor Promise reject bug
  • 0.3.9 (2020-10-28)

    • fix [ApiService] Minor error handler bugfix
  • 0.3.8 (2020-10-28)

    • fix [ApiService] Fixed bug when no error handler is defined
  • 0.3.7 (2020-10-19)

    • fix [Package] Fixed Version
  • 0.3.6 (2020-10-19)

    • feature [ApiService] Added new method setHeaders and axios
  • 0.3.5 (2020-09-03)

    • bug [CrudService] Fixed save method
  • 0.3.4 (2020-07-17)

    • change [Git] Changed scope to izzle-org
  • 0.3.0 (2020-07-17)

    • change [Git] Pushed from gitlab to github and changed scope to sicbb
  • 0.2.0 (2019-06-25)

    • change [CrudService] Changed Crud Service methods params to make params and config easier
    • change [ApiService] Changed Api Service methods params to make params and config easier
  • 0.1.0 (2019-06-24)

    • feature [CrudService] Added Crud Service axios config param
    • change [ApiService] Changed Api Service methods to set axios config param