@bapp/api-client
TypeScript icon, indicating that this package has built-in type declarations

1.4.32 • Public • Published

@bapp/api-client

Client to consume BAPP API, auto-generated using openapi-typescript-codegen.

Example Usage

import { bappAxiosClient, OpenAPI, CoreService, CompanyService } from '@bapp/api-client';

// Authentication
OpenAPI.TOKEN = "<YOUR_TOKEN>";
// OR
OpenAPI.TOKEN = async () => {
  // Custom logic to get API TOKEN, return empty string if token not available
};

// Usage
CoreService.coreCorList({}); // Get first page of COR codes
CoreService.coreCorList({ page: 2 }); // Get 2nd page of COR codes

CompanyService.companyBankAccountsList({ xCompanyId: 1,  }); // Get first page of company bank accounts
CompanyService.companyBankAccountsRetrieve({ xCompanyId: 1, id: 1 }); // Get company bank account with id 1

// Use the axios instance that the api client uses to make requests
bappAxiosClient.interceptors.response.use(undefined, (error) => {
  console.error(error);
});

Dependencies (2)

Dev Dependencies (7)

Package Sidebar

Install

npm i @bapp/api-client

Homepage

cbsoft.ro

Weekly Downloads

15

Version

1.4.32

License

MIT

Unpacked Size

1.63 MB

Total Files

15

Last publish

Collaborators

  • ferretcbsoft
  • ovalentin
  • cristiboboc