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

@azify/caas-backoffice-sdk

v1.4.0

Published

TypeScript SDK for Azify CaaS Backoffice API - Partners and Vaults management

Readme

Azify Backoffice SDK

SDK em TypeScript para integração com a API Azify Backoffice, fornecendo acesso fácil às funcionalidades de gerenciamento de Partners e Vaults.

Instalação

npm install @azify/caas-backoffice-sdk

Início Rápido

import { CaasBackofficeSDK } from '@azify/caas-backoffice-sdk';

const sdk = new CaasBackofficeSDK({
  baseUrl: 'https://caas.aztech.rest/api/v1.0/Backoffice',
  clientId: 'seu-client-id',
  clientSecret: 'seu-client-secret',
});

Exemplos de Uso

Gerenciamento de Partners

// Listar partners paginados
const partners = await sdk.partners.getPaginated({
  page: 1,
  perPage: 10,
});
console.log('Partners:', partners);

// Obter partner por ID
const partner = await sdk.partners.getById({ id: 123 });
console.log('Partner:', partner);

// Desabilitar ou habilitar partner
const result = await sdk.partners.disableOrEnable({ id: 123 });
console.log('Status alterado:', result);

Gerenciamento de Vaults

// Listar vaults paginados
const vaults = await sdk.vaults.getPaginated({
  page: 1,
  perPage: 10,
  partnerId: 123, // opcional
});
console.log('Vaults:', vaults);

// Obter vault por UUID
const vault = await sdk.vaults.getByUuid({ uuid: 'uuid-do-vault' });
console.log('Vault:', vault);

// Obter saldo de um ativo do vault
const balance = await sdk.vaults.getAssetBalance({
  vaultUuid: 'uuid-do-vault',
  currency: 'BTC_TEST',
});
console.log('Saldo:', balance);

Tratamento de Erros

import { BackofficeSDKError } from '@azify/backoffice-sdk';

try {
  const partner = await sdk.partners.getById({ id: 123 });
} catch (error) {
  if (error instanceof BackofficeSDKError) {
    console.error('Erro do SDK:', {
      message: error.message,
      statusCode: error.statusCode,
      details: error.details
    });
  } else {
    console.error('Erro inesperado:', error);
  }
}

Exemplo Completo

import { CaasBackofficeSDK, BackofficeSDKError } from '@azify/backoffice-sdk';

async function exemploCompleto() {
  const sdk = new CaasBackofficeSDK({
    baseUrl: 'https://caas.aztech.rest/api/v1.0/Backoffice',
    clientId: 'seu-client-id',
    clientSecret: 'seu-client-secret',
    timeout: 30000,
    retries: 3,
    retryDelay: 1000,
  });

  try {
    // 1. Listar partners
    const partners = await sdk.partners.getPaginated({
      page: 1,
      perPage: 10,
    });
    console.log('✅ Partners encontrados:', partners.total);

    // 2. Obter detalhes de um partner
    if (partners.result.length > 0) {
      const partner = await sdk.partners.getById({ id: partners.result[0].id });
      console.log('✅ Partner:', partner.name);
    }

    // 3. Listar vaults
    const vaults = await sdk.vaults.getPaginated({
      page: 1,
      perPage: 10,
    });
    console.log('✅ Vaults encontrados:', vaults.total);

    // 4. Obter saldo de um vault
    if (vaults.result.length > 0) {
      const balance = await sdk.vaults.getAssetBalance({
        vaultUuid: vaults.result[0].uuid,
        currency: 'BTC_TEST',
      });
      console.log('💰 Saldo:', balance.available);
    }
    
  } catch (error) {
    if (error instanceof BackofficeSDKError) {
      console.error('❌ Erro na operação:', error.message);
    } else {
      console.error('❌ Erro inesperado:', error);
    }
  }
}

exemploCompleto();

Autenticação

O SDK utiliza autenticação Basic Auth. Você deve fornecer clientId e clientSecret na configuração do SDK:

const sdk = new CaasBackofficeSDK({
  baseUrl: 'https://caas.aztech.rest/api/v1.0/Backoffice',
  clientId: 'seu-client-id',
  clientSecret: 'seu-client-secret',
});

Tipos TypeScript

O SDK inclui tipos TypeScript abrangentes para todas as requisições e respostas da API, proporcionando:

  • Autocompletar no IDE
  • Verificação de tipos em tempo de compilação
  • Documentação inline dos parâmetros
  • Tratamento de erros tipado

Configuração Avançada

const sdk = new BackofficeSDK({
  baseUrl: 'https://caas.aztech.rest/api/v1.0/Backoffice',
  clientId: 'seu-client-id',
  clientSecret: 'seu-client-secret',
  timeout: 30000,        // Timeout em milissegundos (padrão: 30000)
  retries: 3,            // Número de tentativas em caso de falha (padrão: 1)
  retryDelay: 1000,      // Delay entre tentativas em milissegundos (padrão: 1000)
});

// Atualizar configuração após criação
sdk.updateConfig({
  timeout: 60000,
});

Licença

MIT