JSPM

minimax-client

0.1.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q15274F
  • License MIT

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

Package Exports

  • minimax-client
  • minimax-client/dist/index.esm.js
  • minimax-client/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (minimax-client) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

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