UrielCh / proxmox-api

TypeScript Api for proxmox
56 stars 15 forks source link

Fix all issue #27

Closed Pribess closed 5 months ago

Pribess commented 10 months ago

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch proxmox-api@1.0.2 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/proxmox-api/dist/esm/model.d.ts b/node_modules/proxmox-api/dist/esm/model.d.ts
index cb5cfa9..bf339f4 100644
--- a/node_modules/proxmox-api/dist/esm/model.d.ts
+++ b/node_modules/proxmox-api/dist/esm/model.d.ts
@@ -2735,7 +2735,7 @@ export declare namespace Proxmox {
         /**
          * Used memory in bytes (when type in node,qemu,lxc).
          */
-        mem?: string;
+        mem?: number;
         /**
          * Name of the resource.
          */
diff --git a/node_modules/proxmox-api/package.json b/node_modules/proxmox-api/package.json
index f2ac123..aa8b2c5 100644
--- a/node_modules/proxmox-api/package.json
+++ b/node_modules/proxmox-api/package.json
@@ -50,5 +50,6 @@
     "url": "https://github.com/UrielCh/proxmox-api/issues"
   },
   "homepage": "https://urielch.github.io/proxmox-api/",
-  "files": ["dist", "src"]
+  "files": ["dist", "src"],
+  "type": "module"
 }
\ No newline at end of file

This issue body was partially generated by patch-package.

UrielCh commented 10 months ago

I do not set "type": "module" so this package can be use as a ESM module and a commonJS module.

please double check for the mem how do proxmox react with a number as sting, and what is the version used ?

Pribess commented 10 months ago

proxmox 8.0.3 gives me integer. at /cluster/resources endpoint

Pribess commented 10 months ago

and if i remove "type": "module" and run with pure version of package.json it shows this error

Screenshot 2023-09-26 at 8 14 36 AM
UrielCh commented 6 months ago

I had just regen the project for pve 8

Pribess commented 5 months ago

LGTM. I appreciate your effort.