1.3.7 • Published 3 years ago

nax-rest-api-client v1.3.7

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago
import {Router, BaseRouter, Permission} from 'rest-api-client'

class Post extends Router<Data>{
  abstract baseUrl: string;
  abstract secret: string;
  encript_data = false;
  encript_query = true;

  configs: AxiosRequestConfig = {}
  headers: AxiosRequestConfig["headers"] = {}

  async request?(_options: AxiosRequestConfig): Promise<AxiosRequestConfig | void>;
  async response?(_res: AxiosResponse): Promise<AxiosResponse | void>
  async catchError?(err: AxiosError): Promise<void>;

  constructor(){
    super()
    this.use(() => {}, ...)
    this.use('/path', () => {}, ...)
  }
  
}

const post = new Post

post.get('/', {...AxiosRequestConfig})
post.post('/', {...AxiosRequestConfig})
post.put('/', {...AxiosRequestConfig})
post.del('/', {...AxiosRequestConfig})
post.patch('/', {...AxiosRequestConfig})
post.options('/', {...AxiosRequestConfig})
post.options('/', {...AxiosRequestConfig})
post.abort(method, path)
post.isFatching(method, path)



/// Permission
// props - /types/Permission.ts
Permission.create(path: string, props)
Permission.get(path: string)
Permission.delete(path: string)
Permission.getAll()


class Base extends BaseRouter{}
const BR = new Base
1.3.7

3 years ago

1.2.8

3 years ago

1.3.6

3 years ago

1.2.7

3 years ago

1.3.5

3 years ago

1.2.6

3 years ago

1.2.5

3 years ago

1.3.3

3 years ago

1.2.4

3 years ago

1.3.2

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.2.9

3 years ago

1.2.3

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.9

3 years ago

1.1.8

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago