npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@noukha-technologies/mdm-client

v1.0.4

Published

Client library for consuming Noukha MDM services

Readme

@noukha/mdm-client

Client library for consuming Noukha MDM (Master Data Management) services via HTTP API.

Installation

npm install @noukha/mdm-client

Features

  • HTTP Client: Axios-based HTTP client with retry logic
  • Group Management: Full CRUD operations for groups
  • Schema Management: Dynamic schema creation and management
  • Record Management: CRUD operations for dynamic records
  • Bulk Operations: Bulk create, update, and delete operations
  • File Upload: Excel file upload support
  • Error Handling: Comprehensive error handling with retry logic
  • TypeScript Support: Full TypeScript support with type definitions

Quick Start

1. Initialize the Client

import { MdmClient } from '@noukha/mdm-client';

const client = new MdmClient({
  baseUrl: 'http://localhost:3000/api',
  apiKey: 'your-api-key', // optional
  timeout: 30000,
  retries: 3
});

2. Use the Client

// Create a group
const group = await client.createGroup({
  groupName: 'products',
  displayName: 'Products'
});

// Create a schema
const schema = await client.createSchema({
  name: 'product',
  displayName: 'Product',
  fields: [
    {
      name: 'name',
      type: FieldType.STRING,
      required: true,
      unique: true
    },
    {
      name: 'price',
      type: FieldType.NUMBER,
      required: true
    }
  ]
});

// Create a record
const record = await client.createRecord('product', {
  data: {
    name: 'Sample Product',
    price: 99.99
  }
});

// Get all records with pagination
const records = await client.getAllRecords('product', {
  page: 1,
  limit: 10,
  search: 'sample'
});

API Reference

Group Management

// Create a group
await client.createGroup(createGroupDto: CreateGroupDto): Promise<Group>

// Get all groups
await client.getAllGroups(): Promise<Group[]>

// Get a specific group
await client.getGroup(groupId: string): Promise<Group>

// Update a group
await client.updateGroup(groupId: string, updateGroupDto: UpdateGroupDto): Promise<Group>

// Delete a group
await client.deleteGroup(groupId: string): Promise<void>

Schema Management

// Create a schema
await client.createSchema(createSchemaDto: CreateSchemaDto): Promise<any>

// Get all schemas with pagination
await client.getAllSchemas(query?: FindSchemasQueryDto): Promise<PaginatedResponse<CreateSchemaDto>>

// Get a specific schema
await client.getSchema(schemaName: string): Promise<CreateSchemaDto>

// Update a schema
await client.updateSchema(schemaName: string, updateSchemaDto: CreateSchemaDto): Promise<any>

// Delete a schema
await client.deleteSchema(schemaName: string, force?: boolean): Promise<any>

// Get schemas by group ID
await client.getSchemasByGroupId(groupId: string): Promise<CreateSchemaDto[]>

Record Management

// Create a record
await client.createRecord(schemaName: string, createRecordDto: CreateRecordDto): Promise<any>

// Get all records with pagination
await client.getAllRecords(schemaName: string, query?: FindRecordsQueryDto): Promise<PaginatedResponse<any>>

// Get a specific record
await client.getRecord(schemaName: string, recordId: string): Promise<any>

// Update a record
await client.updateRecord(schemaName: string, recordId: string, updateRecordDto: UpdateRecordDto): Promise<any>

// Delete a record
await client.deleteRecord(schemaName: string, recordId: string): Promise<any>

Bulk Operations

// Bulk create records
await client.bulkCreateRecords(schemaName: string, records: CreateRecordDto[]): Promise<any[]>

// Bulk update records
await client.bulkUpdateRecords(schemaName: string, updates: Array<{ id: string; data: any }>): Promise<any>

// Bulk delete records
await client.bulkDeleteRecords(schemaName: string, ids: string[]): Promise<any>

File Upload

// Upload Excel file
await client.uploadExcelFile(file: File | Buffer, filename?: string): Promise<any>

Health Check

// Check service health
await client.healthCheck(): Promise<any>

Configuration

interface MdmClientConfig {
  baseUrl: string;                    // Base URL of the MDM service
  apiKey?: string;                    // API key for authentication
  timeout?: number;                   // Request timeout in milliseconds (default: 30000)
  retries?: number;                   // Number of retries for failed requests (default: 3)
  headers?: Record<string, string>;   // Additional headers
}

Error Handling

The client includes comprehensive error handling:

  • Automatic Retries: Failed requests are automatically retried with exponential backoff
  • Error Messages: Detailed error messages from the API
  • Type Safety: TypeScript ensures type safety for all operations
try {
  const group = await client.createGroup({
    groupName: 'products',
    displayName: 'Products'
  });
} catch (error) {
  console.error('Failed to create group:', error.message);
}

Pagination

All list operations support pagination:

const records = await client.getAllRecords('product', {
  page: 1,
  limit: 10,
  search: 'sample',
  sort: 'createdAt',
  order: 'desc',
  filters: {
    isActive: true
  }
});

console.log(records.data);        // Array of records
console.log(records.meta.total);  // Total count
console.log(records.meta.page);   // Current page
console.log(records.meta.limit);  // Items per page
console.log(records.meta.totalPages); // Total pages

Search and Filtering

Most operations support search and filtering:

// Search records
const records = await client.getAllRecords('product', {
  search: 'laptop',
  filters: {
    price: { $gte: 100 },
    category: 'electronics'
  }
});

// Search schemas
const schemas = await client.getAllSchemas({
  search: 'product',
  groupId: 'group123'
});

License

MIT