Giter Site home page Giter Site logo

corsinvest / cv4pve-api-javascript Goto Github PK

View Code? Open in Web Editor NEW
20.0 2.0 3.0 299 KB

Proxmox VE Client API JavaScript

Home Page: https://www.corsinvest.it/cv4pve

License: GNU General Public License v3.0

JavaScript 100.00% PowerShell 0.01%
proxmox proxmox-ve proxmox-apis api api-client api-rest javascript proxmox-cluster pve api-gateway

cv4pve-api-javascript's People

Contributors

florian7843 avatar franklupo avatar markhhm avatar xpirec avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cv4pve-api-javascript's Issues

src/index.js doesnt load

What happened?

i downloaded the file in src/index.js, and tried to load it in my normal file and got the following output

Expected behavior

it should have loaded up and excecuted, all i have is
const pve = require("./src/index")
in my file

Relevant log output

C:\Users\my username\Downloads\carea\src\index.js:198
    async #execute(method, resource, parameters) {
                  ^

SyntaxError: Unexpected token '('
    at wrapSafe (internal/modules/cjs/loader.js:1054:16)
    at Module._compile (internal/modules/cjs/loader.js:1102:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
    at Module.load (internal/modules/cjs/loader.js:986:32)
    at Function.Module._load (internal/modules/cjs/loader.js:879:14)
    at Module.require (internal/modules/cjs/loader.js:1026:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (C:\Users\ryan\Downloads\carea\index.js:2:13)
    at Module._compile (internal/modules/cjs/loader.js:1138:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)

Proxmox VE Version

7.0-11

Version (bug)

what

Version (working)

No response

On what operating system are you experiencing the issue?

Windows

Pull Request

  • I would like to do a Pull Request

Simplified parameter setting

First of all, thank you for developing such a useful library for everyone to use. I find it very convenient.
I encountered a problem where PVE could not resolve the Token when using APIToken. I found that it was on line 229 of src/index.js

if (this.apiToken != '') { headers['Authorization'] = "PVEAPIToken " + this.apiToken; } 

There is a missing = after PVEAPIToken.
Currently, I can use it by adding an = in front of it, as follows:

 client.apiToken = '=' + this.configService.get('PVE_API_TOKEN');

Therefore, changing PVEAPIToken to PVEAPIToken= should make it easier for users to use.

File separation

I was reviewing the codebase as I was interested in using this for a personal project. I was wondering if you would be open to me creating a PR to separate everything within the index.js file into separate more appropriate files?

This will certainly help with readability and for future contributors.

I would have went ahead and done the change but figured I would ask beforehand, as I realised a lot of the code may be automatically generated, given its 17k lines.

feat: Type definitions for Response

Right now the project has great autocompletion for creating the requests. But not for responses from the API.

This change would make the package more usable.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.