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

Package detail

minimax-client

miljantekic32MIT0.1.3TypeScript support: included

TypeScript client library for the Minimax accounting API (https://moj.minimax.rs/RS/API/)

minimax, accounting, api, client, serbia

readme

Minimax Client

npm version License: MIT Status: Development

A TypeScript client library for the Minimax accounting API (https://moj.minimax.rs/RS/API/).

⚠️ IMPORTANT: This library is still in active development and not intended for production use. Breaking changes may occur between versions.

Features

  • TypeScript-based with full type definitions
  • Node.js backend usage (not browser)
  • Axios for HTTP client
  • Handle authentication and sessions internally
  • English for library interface, preserve original API error messages
  • Handle concurrency with RowVersion

Installation

npm install minimax-client

Or with yarn:

yarn add minimax-client

Usage

import { MinimaxClient } from 'minimax-client';

// Initializes the client and authenticates
const client = new MinimaxClient({
  clientId: 'your-client-id',
  clientSecret: 'your-client-secret',
  username: 'your-username',
  password: 'your-password',
});

// Use the API
const invoices = await client.invoices.getAll();

Development

Setup

# Install dependencies
npm install

# Build the project
npm run build

# Run tests
npm test

Available Scripts

  • npm run clean - Clean the dist directory
  • npm run build - Build the project
  • npm run build:dev - Build the project in watch mode
  • npm run test - Run tests
  • npm run lint - Run linting
  • npm run lint:fix - Fix linting issues
  • npm run format - Format code with Prettier
  • npm run format:check - Check formatting without making changes

API Resources

The client provides access to the following Minimax API resources:

  • Invoices
  • Customers
  • Journals
  • (More resources coming soon)

Error Handling

try {
  const result = await client.invoices.getById('invalid-id');
} catch (error) {
  if (error.isMinimaxError) {
    // Handle Minimax API error
    console.error(`API Error: ${error.message}`);
    console.error(`Status: ${error.status}`);
  } else {
    // Handle network or other errors
    console.error('Unexpected error:', error);
  }
}

Documentation

For more detailed information about the Minimax API and how to use this client, please refer to:

License

MIT