Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@atno/ts-glpi-client
Advanced tools
TS-GLPI-CLIENT is a TypeScript client library for interacting with the GLPI (Gestionnaire Libre de Parc Informatique) API. This library provides a set of classes to perform various operations such as authentication, retrieval, addition, and updating of resources.
To install the TS-GLPI-CLIENT library, use npm or yarn:
npm install ts-glpi-client
or
yarn add ts-glpi-client
The GLPIClient class is used to manage authentication and create instances of other GLPI API client classes.
import { GLPIClient } from "ts-glpi-client";
const client = new GLPIClient("base_url", "app_token");
// Authenticate with user and password
client.authenticateWithUserAndPassword("user", "password").then((apiClient) => {
// Use apiClient to access other endpoints
});
// Authenticate with a user token
client.authenticateWithToken("user_token").then((apiClient) => {
// Use apiClient to access other endpoints
});
import { GLPIClient } from "ts-glpi-client";
const client = new GLPIClient("base_url", "app_token");
// Authenticate and get the actives endpoint
client.authenticateWithUserAndPassword("user", "password").then((apiClient) => {
// Access the actives endpoint
const actives = apiClient.actives;
// Retrieve a item by id of specified itemtype from endpoint
apiclient.endpoint
.getById("itemtype", itemID)
.then((item) => {
console.log("Item by ID:", item);
})
.catch((error) => {
console.error("Error retrieving item by ID:", error);
});
// Retrieve all items of specified itemtype from endpoint
apiclient.endpoint
.getAll("itemtype")
.then((items) => {
console.log("All items:", items);
})
.catch((error) => {
console.error("Error retrieving all items:", error);
});
// Update an item of specific itemtype from endpoint
apiclient.endpoint
.update("itemtype", itemID, { field: "value" })
.then((response) => {
console.log("Update response:", response);
})
.catch((error) => {
console.error("Error updating item:", error);
});
// Add a new item of specific itemtype from endpoint
actives
.add("itemtype", { field: "value" })
.then((response) => {
console.log("Add response:", response);
})
.catch((error) => {
console.error("Error adding item:", error);
});
});
If you would like to contribute to this project, please submit a pull request or open an issue.
Gilmar Antonio 💻 🖋 📖 🤔 🚇 🚧 📆 🔧 |
This project is licensed under the MIT License - see the LICENSE file for details.
💙 This package was templated with create-typescript-app.
FAQs
A (partial)fulltyped GLPI API client
We found that @atno/ts-glpi-client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.