JSPM

@cx-reports/api-client

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

Connect to CxReports API from your application.

Package Exports

  • @cx-reports/api-client
  • @cx-reports/api-client/v1.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 (@cx-reports/api-client) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

TypeScript API Client for CxReports

This library allows you to connect to the CxReports API from your applications.

import { CxReportsClient } from "@cx-reports/api-client";

const client = new CxReportsClient({
  baseUrl: "https://demo.cx-reports.com",
  authToken: "xyz",
  defaultWorkspaceId: 123,
  defaultWorkspaceCode: "test",
});

let reports = await client.getReports({ type: "invoice" });

let nonce = await client.createSingleUseWebAuthToken();

let url = client.getReportPreviewUrl({
  reportId: 123,
  reportType: "invoice",
  params: {},
  data: {},
  tmpDataId: 1
  nonce,
});

let pdf = client.getReportPdfUrl({ reportId: 123, params: {} });

let types = await client.getReportTypes();

let content = client.downloadReportPdf(123, { reportId: 123, params: {} });