Fully-typed, generated api wrapper for mspecs based on the official documentation.
TODO
npm install --save mspecs
import { MspecsClient } from 'mspecs';
const client = new MspecsClient({
host: 'https://api.mspecs.se', // tested with demo.mspecs.se and api.mspecs.se
auth: {
username: 'YOUR_USERNAME',
password: 'YOUR_PASSWORD'
}
});
const deals = await client.deals.all({
collections: ['sellers'],
limit: 5
});
Custom fields aren't fully typed right now. It's on the todo list to add some way to overload those definitions.
const deal = await client.deals.byId('M4341fdf53d..', { customFields: true });
console.log(deal.customFieldValues)
TODO
- Tests
- Refactor and structure generation
- Add support for different mspecs versions (demo & api)
- Add support for more languages, f.e. C♯.
- Add more examples