12.1.0 • Published 2 months ago

@sparing-software/sparing-open-api v12.1.0

Weekly downloads
9
License
MIT
Repository
github
Last release
2 months ago

Installation

npm i @sparing-software/sparing-open-api

Usage

Create a sparing-open-api.config.js file at the root of the project

/** @type {import('@sparing-software/sparing-open-api').Config} */
export default {
  url: 'https://example.com/schema/'
}

To comfortly use generated service in futher application consider creating another file in service folder:

service/http.service.ts

import { Api } from './$OPEN_API_OUT_FILENAME'

export const httpService = new Api({
  baseURL: process.env.VUE_APP_API_URL
})

httpService.instance.interceptors.request.use(config => {
  config.headers.Authorization = localStorage.getItem('token')
  return config
})

Which can be later easily used as follows:

import { httpService } from '@/service/http.service'
const issues = await httpService.projects.getIssues(project.id)

It is also recommended to add prebuild and preserve/predev scripts to your package.json file in order to get the newest api on each start:

{
  "scripts": {
    "prebuild": "sparing-open-api",
    "preserve": "sparing-open-api",
    ...
  }
}

Or you can always do it manually by running sparing-open-api from terminal opened inside your project.

Contributing

Want to help improve this plugin? Great!
Project is open-source so fork repo and join us!

Releasing and versioning

Use Conventional Commits to automatically bump major, minor and patch versions. Read more about semantic releasing in this docs.

License

MIT License © Sparing Interactive

12.1.0

2 months ago

12.1.0-beta.2

2 months ago

12.1.0-beta.1

2 months ago

12.0.0

6 months ago

11.1.1

6 months ago

11.0.0

7 months ago

11.1.0

6 months ago

10.0.3

11 months ago

10.0.2

1 year ago

11.0.0-beta.6

1 year ago

11.0.0-beta.7

1 year ago

11.0.0-beta.8

1 year ago

11.0.0-beta.9

1 year ago

11.0.0-beta.10

1 year ago

11.0.0-beta.5

1 year ago

11.0.0-beta.0

1 year ago

11.0.0-beta.1

1 year ago

11.0.0-beta.2

1 year ago

11.0.0-beta.3

1 year ago

11.0.0-beta.4

1 year ago

10.0.0

2 years ago

10.0.1

2 years ago

9.0.0

2 years ago

8.0.1

2 years ago

8.0.2

2 years ago

5.0.0

3 years ago

8.0.0

3 years ago

6.0.0

3 years ago

7.0.0

3 years ago

4.0.1

3 years ago

3.0.0

3 years ago

2.0.0

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.1

3 years ago

1.1.2

3 years ago

1.0.0

3 years ago