Skip to content

Commit

Permalink
feat: update package & v1 release
Browse files Browse the repository at this point in the history
  • Loading branch information
devnote-dev committed Oct 27, 2022
1 parent 8c89b31 commit 6626b43
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 14 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Changelog
Tracking changes for PteroJSLite (using [SemVer 2](https://semver.org)).

## 1.0.0 - 26-10-2022
## 1.0.0 - 27-10-2022
First official release, using only objects/structures, interfaces and functions - no classes!

## 0.1.0 - 08-2022
Expand Down
18 changes: 14 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<h1 align="center">PteroJSLite</h1>
<h3 align="center"><strong>A lightweight alternative to PteroJS</strong></h3>
<p align="center"><a href="https://discord.com/invite/dwcfTjgn7S" type="_blank"><img src="https://img.shields.io/badge/discord-join-5865f2?style=for-the-badge&logo=discord&logoColor=white"></a> <img src="https://img.shields.io/badge/version-2.1.0-3572A5?style=for-the-badge"> <img src="https://img.shields.io/github/issues/PteroPackages/PteroJSLite.svg?style=for-the-badge"> <!--<a href="https://pteropackages.github.io/PteroJS/" type="_blank"><img src="https://img.shields.io/badge/docs-typedoc-e67e22?style=for-the-badge"></a>--></p>
<p align="center"><a href="https://discord.com/invite/dwcfTjgn7S" type="_blank"><img src="https://img.shields.io/badge/discord-join-5865f2?style=for-the-badge&logo=discord&logoColor=white"></a> <img src="https://img.shields.io/badge/version-1.0.0-3572A5?style=for-the-badge"> <img src="https://img.shields.io/github/issues/PteroPackages/PteroJSLite.svg?style=for-the-badge"> <!--<a href="https://pteropackages.github.io/PteroJS/" type="_blank"><img src="https://img.shields.io/badge/docs-typedoc-e67e22?style=for-the-badge"></a>--></p>

## About

PteroJSLite is a lightweight alternative to [PteroJS](https://github.com/PteroPackages/PteroJS) using only objects and functions - absolutely no classes! This package is ideal if you want a high-level package without the abstractions and helper methods of larger libraries while still getting same amount of functionality.
PteroJSLite is a lightweight alternative to [PteroJS](https://github.com/PteroPackages/PteroJS) using only objects and functions - absolutely no classes! This package is ideal if you want a high-level package without the abstractions and helper methods of larger libraries, while still getting same amount of functionality.

## Installing

You must have NodeJS v14 and above to use this package.
You must have NodeJS v14 or above to use this package.

```
npm install @devnote-dev/pterojslite
Expand All @@ -21,14 +21,19 @@ PteroJSLite supports version 1.7+ of the panel, and version 1.6+ of Wings.

## Getting Started

Application and Client API instances can be created using the `createApp` and `createClient` functions respectively. Both application keys (ptla) and client keys (ptlc) are currently supported.
Application and Client API instances can be created using the `createApp` and `createClient` functions respectively. Both application keys (`ptla`) and client keys (`ptlc`) are currently supported.

```js
const { createApp } = require('@devnote-dev/pterojslite');

const app = createApp('https://your.panel.domain', 'ptla_your_api_key');

app.getServers().then(console.log);

(async () => {
const users = await app.getUsers(); // returns an array of user objects
console.log(users.filter(u => u.rootAdmin)); // filters out non-admin users
})();
```

```js
Expand All @@ -37,6 +42,11 @@ const { createClient } = require('@devnote-dev/pterojslite');
const client = createClient('https://your.panel.domain', 'ptlc_your_api_key');

client.getAccount().then(console.log);

(async () => {
const activities = await app.getActivities(); // returns an array of activity logs
console.log(activities.filter(a => a.isAPI)); // filters out non-API activities
})();
```

## Contributing
Expand Down
17 changes: 11 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@devnote-dev/pterojslite",
"version": "0.0.1",
"version": "1.0.0",
"description": "A lightweight version of the PteroJS package",
"author": "Devonte W <https://github.com/devnote-dev>",
"license": "MIT",
Expand All @@ -13,7 +13,7 @@
"url": "git+https://github.com/PteroPackages/PteroJSLite.git"
},
"main": "./dist/src/index.js",
"types": "./dist/src/types",
"types": "./dist/src/types/index.d.ts",
"files": [
"dist",
"CHANGELOG.md",
Expand All @@ -24,21 +24,26 @@
"node": ">=14.16"
},
"scripts": {
"prepublish": "tsc",
"build": "tsc",
"lint": "prettier --write src/**/**.ts"
},
"keywords": [
"api",
"nodejs",
"pterojs",
"wrapper",
"javascript",
"typescript",
"pterojslite",
"pterodactyl",
"pterodactyl-api",
"wrapper"
"pterodactyl-api"
],
"dependencies": {
"axios": "^0.27.2"
},
"devDependencies": {
"@types/node": "^18.6.4",
"prettier": "^2.7.1",
"typedoc": "^0.23.17"
"prettier": "^2.7.1"
}
}
4 changes: 1 addition & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { version as v } from '../package.json';

export const version = v;
export { version } from '../package.json';

// Application API
export * from './app';
Expand Down

0 comments on commit 6626b43

Please sign in to comment.