npm package: @siamf/teamdesk
Description: A Node.js TeamDesk API client for placing API requests directly to TeamDesk from Node.js. It supports almost all teamdesk api method and query params
Author: Siam Ahnaf
Latest version: 1.5.2

<br/>
<picture>
  <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/siamahnaf/assets-kit/main/logo/logo-white.png">
  <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/siamahnaf/assets-kit/main/logo/logo-black.png">
  <img alt="Siam Ahnaf" src="https://raw.githubusercontent.com/siamahnaf/assets-kit/main/logo/logo-black.png" height="auto" width="240">
</picture>
<br/> <br/>

# @siamf/teamdesk
A Node.js TeamDesk API client for placing API requests directly to TeamDesk from Node.js. It supports almost all teamdesk api method and query params

<a href="https://www.buymeacoffee.com/siamahnaf" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" ></a>

- Small Size
- All Available Teamdesk Method
- Place request or create URI
- Edge runtime support

# Installation

```bash
$ npm i @siamf/teamdesk
```

```javascript
import { initTeamdesk } from "@siamf/teamdesk";

type Table = "Table 1" | "Table 2";

const teamdesk = initTeamdesk<Table>({
    baseUrl: "https://teamdesk.net/secure/api/v2", //Teamdesk Base URL
    databaseNo: 96301, //Teamdesk Database Number
    token: "teamdesk api token", //Teamdesk API token
});

interface Generated {
    id?: string;
    name?: string;
    description?: string;
    culture?: string;
    timeZone?: string;
    logo?: number;
}

//Generate URL
const url = teamdesk.describeTable.uri({
    table: "Table 1"
})
console.log(url);

//Place API Request
const { data, error } = await teamdesk.describeTable.request<Generated>({
    table: "Table 2"
});

console.log(data);
console.log(error);

```

# Documentations

Please see the teamdesk API [docs](https://www.teamdesk.net/help/rest-api/) for details use.

## Connect with me
<div style="display: flex; align-items: center; gap: 3px;">
<a href="https://wa.me/8801611994403"><img src="https://raw.githubusercontent.com/siamahnaf/assets-kit/main/icons/whatsapp.png" width="40" height="40"></a>
<a href="https://siamahnaf.com/" style="margin-right: 8px"><img src="https://raw.githubusercontent.com/siamahnaf/assets-kit/main/icons/web.png" width="40" height="40"></a>
<a href="https://www.linkedin.com/in/siamahnaf/" style="margin-right: 8px"><img src="https://raw.githubusercontent.com/siamahnaf/assets-kit/main/icons/linkedin.png" width="40" height="40"></a>
<a href="https://x.com/siamahnaf198" style="margin-right: 8px"><img src="https://raw.githubusercontent.com/siamahnaf/assets-kit/main/icons/x.png" width="40" height="40"></a>
<a href="https://www.facebook.com/siamahnaf198/" style="margin-right: 8px"><img src="https://raw.githubusercontent.com/siamahnaf/assets-kit/main/icons/facebook.png" width="40" height="40"></a>
<a href="https://t.me/siamahnaf198" style="margin-right: 8px"><img src="https://raw.githubusercontent.com/siamahnaf/assets-kit/main/icons/telegram.png" width="40" height="40"></a>
<a href="https://www.npmjs.com/~siamahnaf" style="margin-right: 8px"><img src="https://raw.githubusercontent.com/siamahnaf/assets-kit/main/icons/npm.png" width="40" height="40"></a>
</div>