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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@apso/sdk

v1.0.5

Published

SDK for Apso services, offering easy access to OpenAPI-compliant CRUD operations.

Readme

Apso SDK

A TypeScript SDK for interacting with Apso services via their OpenAPI-compliant CRUD API.

Installation

npm install @apsoai/sdk

Usage

import { ApsoClientFactory, QueryBuilder } from '@apsoai/sdk';

const config = {
  baseURL: 'https://api.apso-service.com',
  apiKey: 'your-api-key'
};

const client = ApsoClientFactory.getClient(config);

const activeUsers = await client.entity('users')
  .where({ status: { $eq: 'active' } })
  .limit(10)
  .get();

// Advanced Query Example (NestJS CRUD compatible)
const filtered = await client.entity('WorkspaceServices')
  .where({ status: { $eq: 'Active' }, build_status: { $eq: 'Ready' } })
  .orderBy({ created_at: 'DESC' })
  .limit(10)
  .page(1)
  .cache(true)
  .get();
// This produces:
// /WorkspaceServices?filter=status||$eq||Active&filter=build_status||$eq||Ready&sort=created_at,DESC&limit=10&page=1&cache=0

// You can also use the low-level API:
const response = await client.get('/WorkspaceServices', {
  filter: {
    status: { $eq: 'Active' },
    build_status: { $eq: 'Ready' }
  },
  sort: { created_at: 'DESC' },
  limit: 10,
  page: 1,
  cache: true
});

// This will generate a standards-compliant query string for NestJS CRUD APIs.

## Test Examples

Here are some Jest test examples for the SDK:

```typescript
import { ApsoClientFactory } from '@apsoai/sdk';
import axios from 'axios';
import MockAdapter from 'axios-mock-adapter';

describe('Apso SDK Client', () => {
  const config = {
    baseURL: 'https://api.example.com',
    apiKey: 'test-api-key',
    client: 'axios' as const
  };
  const client = ApsoClientFactory.getClient(config);
  const mock = new MockAdapter(axios);

  afterEach(() => {
    mock.reset();
  });

  test('GET with filter and limit', async () => {
    mock.onGet('/HopperLoads?filter=status||$eq||active&limit=10').reply(200, { data: 'mockData' });
    const data = await client.entity('HopperLoads').where({ status: { $eq: 'active' } }).limit(10).get();
    expect(data).toEqual({ data: 'mockData' });
  });

  test('GET with join and sort', async () => {
    mock.onGet('/HopperLoads?join=relatedEntity&sort=created_at,ASC').reply(200, { data: 'mockData' });
    const data = await client.entity('HopperLoads').join(['relatedEntity']).orderBy({ created_at: 'ASC' }).get();
    expect(data).toEqual({ data: 'mockData' });
  });

  test('POST with data', async () => {
    mock.onPost('/HopperLoads', { name: 'New Load' }).reply(201, { data: 'createdData' });
    const data = await client.entity('HopperLoads').post({ name: 'New Load' });
    expect(data).toEqual({ data: 'createdData' });
  });

  test('PUT with data', async () => {
    mock.onPut('/HopperLoads', { name: 'Updated Load' }).reply(200, { data: 'updatedData' });
    const data = await client.entity('HopperLoads').put({ name: 'Updated Load' });
    expect(data).toEqual({ data: 'updatedData' });
  });

  test('DELETE', async () => {
    mock.onDelete('/HopperLoads').reply(200, { message: 'Deleted successfully' });
    const data = await client.entity('HopperLoads').delete();
    expect(data).toEqual({ message: 'Deleted successfully' });
  });

  test('GET with offset and page', async () => {
    mock.onGet('/HopperLoads?offset=5&page=2').reply(200, { data: 'mockData' });
    const data = await client.entity('HopperLoads').offset(5).page(2).get();
    expect(data).toEqual({ data: 'mockData' });
  });

  test('GET with select and cache', async () => {
    mock.onGet('/HopperLoads?fields=name,age&cache=0').reply(200, { data: 'mockData' });
    const data = await client.entity('HopperLoads').select(['name', 'age']).cache(true).get();
    expect(data).toEqual({ data: 'mockData' });
  });
});