From db1e2ff3cf3e1713f167bb2d9c79c4ed6f514832 Mon Sep 17 00:00:00 2001 From: Alexander Hansson Date: Thu, 27 Aug 2026 06:59:22 +0000 Subject: [PATCH 1/3] Add ColocationRack module --- README.md | 3 +++ lib/endpoints/colocationrack.js | 8 ++++++++ lib/glesys.js | 5 +++++ test/endpoints/colocationrack.js | 20 ++++++++++++++++++++ test/glesys.js | 1 + 5 files changed, 37 insertions(+) create mode 100644 lib/endpoints/colocationrack.js create mode 100644 test/endpoints/colocationrack.js diff --git a/README.md b/README.md index f6e3005..6601f9a 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,9 @@ glesys.email.createAccount({ * [`GleSYSAPI.blockStorage.listTiers()`](https://github.com/GleSYS/API-docs/wiki/API-Documentation#blockstoragelisttiers) * [`GleSYSAPI.blockStorage.resize()`](https://github.com/GleSYS/API-docs/wiki/API-Documentation#blockstorageresize) +### colocationRack +* [`GleSYSAPI.colocationRack.list()`](https://github.com/GleSYS/API-docs/wiki/API-Documentation#colocationracklist) + ### country * [`GleSYSAPI.country.list()`](https://github.com/GleSYS/API-docs/wiki/API-Documentation#countrylist) diff --git a/lib/endpoints/colocationrack.js b/lib/endpoints/colocationrack.js new file mode 100644 index 0000000..7f48d9a --- /dev/null +++ b/lib/endpoints/colocationrack.js @@ -0,0 +1,8 @@ +import { Endpoint } from '../endpoint.js'; + +export class ColocationRack extends Endpoint { + // https://github.com/GleSYS/API-docs/wiki/API-Documentation#colocationracklist + list() { + return this.request.get('/colocationrack/list'); + } +} diff --git a/lib/glesys.js b/lib/glesys.js index aae9710..b13020d 100644 --- a/lib/glesys.js +++ b/lib/glesys.js @@ -2,6 +2,7 @@ import { Account } from './endpoints/account.js'; import { Api } from './endpoints/api.js'; import { Archive } from './endpoints/archive.js'; import { BlockStorage } from './endpoints/blockstorage.js'; +import { ColocationRack } from './endpoints/colocationrack.js'; import { Country } from './endpoints/country.js'; import { Customer } from './endpoints/customer.js'; import { Database } from './endpoints/database.js'; @@ -51,6 +52,10 @@ export class GleSYSAPI { return new BlockStorage(this.request); } + get colocationRack() { + return new ColocationRack(this.request); + } + get country() { return new Country(this.request); } diff --git a/test/endpoints/colocationrack.js b/test/endpoints/colocationrack.js new file mode 100644 index 0000000..2d24b9c --- /dev/null +++ b/test/endpoints/colocationrack.js @@ -0,0 +1,20 @@ +import { ColocationRack } from '../../lib/endpoints/colocationrack.js'; +import { Request } from '../../lib/request.js'; + +describe('endpoints/colocationrack', () => { + let request; + let colocationRack; + + beforeEach(() => { + request = new Request(); + colocationRack = new ColocationRack(request); + }); + + test('list()', () => { + const spy = globalThis.setupRequestSpy(request, 'get'); + + colocationRack.list(); + + expect(spy).toHaveBeenCalledWith('/colocationrack/list'); + }); +}); diff --git a/test/glesys.js b/test/glesys.js index 62891ea..483f84f 100644 --- a/test/glesys.js +++ b/test/glesys.js @@ -19,6 +19,7 @@ describe('GleSYSAPI', () => { expect(glesys.api).toBeDefined(); expect(glesys.archive).toBeDefined(); expect(glesys.blockStorage).toBeDefined(); + expect(glesys.colocationRack).toBeDefined(); expect(glesys.country).toBeDefined(); expect(glesys.customer).toBeDefined(); expect(glesys.database).toBeDefined(); From 94e9032be74bbb87c3d0361944560dd67edda7aa Mon Sep 17 00:00:00 2001 From: Alexander Hansson Date: Thu, 27 Aug 2026 06:59:22 +0000 Subject: [PATCH 2/3] Add RemoteHands module --- README.md | 5 ++++ lib/endpoints/remotehands.js | 18 ++++++++++++++ lib/glesys.js | 5 ++++ test/endpoints/remotehands.js | 44 +++++++++++++++++++++++++++++++++++ test/glesys.js | 1 + 5 files changed, 73 insertions(+) create mode 100644 lib/endpoints/remotehands.js create mode 100644 test/endpoints/remotehands.js diff --git a/README.md b/README.md index 6601f9a..73331ab 100644 --- a/README.md +++ b/README.md @@ -228,6 +228,11 @@ glesys.email.createAccount({ * [`GleSYSAPI.project.edit()`](https://github.com/GleSYS/API-docs/wiki/API-Documentation#projectedit) * [`GleSYSAPI.project.rename()`](https://github.com/GleSYS/API-docs/wiki/API-Documentation#projectrename) +### remoteHands +* [`GleSYSAPI.remoteHands.cancel()`](https://github.com/GleSYS/API-docs/wiki/API-Documentation#remotehandscancel) +* [`GleSYSAPI.remoteHands.create()`](https://github.com/GleSYS/API-docs/wiki/API-Documentation#remotehandscreate) +* [`GleSYSAPI.remoteHands.list()`](https://github.com/GleSYS/API-docs/wiki/API-Documentation#remotehandslist) + ### server * [`GleSYSAPI.server.allowedArguments()`](https://github.com/GleSYS/API-docs/wiki/API-Documentation#serverallowedarguments) * [`GleSYSAPI.server.backup()`](https://github.com/GleSYS/API-docs/wiki/API-Documentation#serverbackup) diff --git a/lib/endpoints/remotehands.js b/lib/endpoints/remotehands.js new file mode 100644 index 0000000..04325fa --- /dev/null +++ b/lib/endpoints/remotehands.js @@ -0,0 +1,18 @@ +import { Endpoint } from '../endpoint.js'; + +export class RemoteHands extends Endpoint { + // https://github.com/GleSYS/API-docs/wiki/API-Documentation#remotehandscancel + cancel(data) { + return this.request.post('/remotehands/cancel', data); + } + + // https://github.com/GleSYS/API-docs/wiki/API-Documentation#remotehandscreate + create(data) { + return this.request.post('/remotehands/create', data); + } + + // https://github.com/GleSYS/API-docs/wiki/API-Documentation#remotehandslist + list() { + return this.request.get('/remotehands/list'); + } +} diff --git a/lib/glesys.js b/lib/glesys.js index b13020d..e8504ac 100644 --- a/lib/glesys.js +++ b/lib/glesys.js @@ -19,6 +19,7 @@ import { ObjectStorage } from './endpoints/objectstorage.js'; import { PaymentCard } from './endpoints/paymentcard.js'; import { PrivateNetwork } from './endpoints/privatenetwork.js'; import { Project } from './endpoints/project.js'; +import { RemoteHands } from './endpoints/remotehands.js'; import { Server } from './endpoints/server.js'; import { ServerDisk } from './endpoints/serverdisk.js'; import { SshKey as Sshkey } from './endpoints/sshkey.js'; @@ -120,6 +121,10 @@ export class GleSYSAPI { return new Project(this.request); } + get remoteHands() { + return new RemoteHands(this.request); + } + get server() { return new Server(this.request); } diff --git a/test/endpoints/remotehands.js b/test/endpoints/remotehands.js new file mode 100644 index 0000000..5e62491 --- /dev/null +++ b/test/endpoints/remotehands.js @@ -0,0 +1,44 @@ +import { RemoteHands } from '../../lib/endpoints/remotehands.js'; +import { Request } from '../../lib/request.js'; + +describe('endpoints/remotehands', () => { + let request; + let remoteHands; + + beforeEach(() => { + request = new Request(); + remoteHands = new RemoteHands(request); + }); + + test('cancel()', () => { + const spy = globalThis.setupRequestSpy(request, 'post'); + const data = { + key: 'abc123', + }; + + remoteHands.cancel(data); + + expect(spy).toHaveBeenCalledWith('/remotehands/cancel', data); + }); + + test('create()', () => { + const spy = globalThis.setupRequestSpy(request, 'post'); + const data = { + executionoption: 'asap', + instructions: 'Reboot the server', + servicekeys: ['abc123'], + }; + + remoteHands.create(data); + + expect(spy).toHaveBeenCalledWith('/remotehands/create', data); + }); + + test('list()', () => { + const spy = globalThis.setupRequestSpy(request, 'get'); + + remoteHands.list(); + + expect(spy).toHaveBeenCalledWith('/remotehands/list'); + }); +}); diff --git a/test/glesys.js b/test/glesys.js index 483f84f..33ec0d6 100644 --- a/test/glesys.js +++ b/test/glesys.js @@ -36,6 +36,7 @@ describe('GleSYSAPI', () => { expect(glesys.paymentCard).toBeDefined(); expect(glesys.privateNetwork).toBeDefined(); expect(glesys.project).toBeDefined(); + expect(glesys.remoteHands).toBeDefined(); expect(glesys.server).toBeDefined(); expect(glesys.serverDisk).toBeDefined(); expect(glesys.sshKey).toBeDefined(); From c0078b1024ce75ba94ab7c748aa073e927446478 Mon Sep 17 00:00:00 2001 From: Alexander Hansson Date: Thu, 27 Aug 2026 06:59:22 +0000 Subject: [PATCH 3/3] Add Shipment module --- README.md | 6 +++++ lib/endpoints/shipment.js | 23 ++++++++++++++++ lib/glesys.js | 5 ++++ test/endpoints/shipment.js | 54 ++++++++++++++++++++++++++++++++++++++ test/glesys.js | 1 + 5 files changed, 89 insertions(+) create mode 100644 lib/endpoints/shipment.js create mode 100644 test/endpoints/shipment.js diff --git a/README.md b/README.md index 73331ab..d2c9f5d 100644 --- a/README.md +++ b/README.md @@ -274,6 +274,12 @@ glesys.email.createAccount({ * [`GleSYSAPI.serverDisk.reconfigure()`](https://github.com/GleSYS/API-docs/wiki/API-Documentation#serverdiskreconfigure) * [`GleSYSAPI.serverDisk.updateName()`](https://github.com/GleSYS/API-docs/wiki/API-Documentation#serverdiskupdatename) +### shipment +* [`GleSYSAPI.shipment.cancel()`](https://github.com/GleSYS/API-docs/wiki/API-Documentation#shipmentcancel) +* [`GleSYSAPI.shipment.create()`](https://github.com/GleSYS/API-docs/wiki/API-Documentation#shipmentcreate) +* [`GleSYSAPI.shipment.edit()`](https://github.com/GleSYS/API-docs/wiki/API-Documentation#shipmentedit) +* [`GleSYSAPI.shipment.list()`](https://github.com/GleSYS/API-docs/wiki/API-Documentation#shipmentlist) + ### sshKey * [`GleSYSAPI.sshKey.add()`](https://github.com/GleSYS/API-docs/wiki/API-Documentation#sshkeyadd) * [`GleSYSAPI.sshKey.list()`](https://github.com/GleSYS/API-docs/wiki/API-Documentation#sshkeylist) diff --git a/lib/endpoints/shipment.js b/lib/endpoints/shipment.js new file mode 100644 index 0000000..d27e1c6 --- /dev/null +++ b/lib/endpoints/shipment.js @@ -0,0 +1,23 @@ +import { Endpoint } from '../endpoint.js'; + +export class Shipment extends Endpoint { + // https://github.com/GleSYS/API-docs/wiki/API-Documentation#shipmentcancel + cancel(data) { + return this.request.post('/shipment/cancel', data); + } + + // https://github.com/GleSYS/API-docs/wiki/API-Documentation#shipmentcreate + create(data) { + return this.request.post('/shipment/create', data); + } + + // https://github.com/GleSYS/API-docs/wiki/API-Documentation#shipmentedit + edit(data) { + return this.request.post('/shipment/edit', data); + } + + // https://github.com/GleSYS/API-docs/wiki/API-Documentation#shipmentlist + list() { + return this.request.get('/shipment/list'); + } +} diff --git a/lib/glesys.js b/lib/glesys.js index e8504ac..fe64a87 100644 --- a/lib/glesys.js +++ b/lib/glesys.js @@ -22,6 +22,7 @@ import { Project } from './endpoints/project.js'; import { RemoteHands } from './endpoints/remotehands.js'; import { Server } from './endpoints/server.js'; import { ServerDisk } from './endpoints/serverdisk.js'; +import { Shipment } from './endpoints/shipment.js'; import { SshKey as Sshkey } from './endpoints/sshkey.js'; import { User } from './endpoints/user.js'; import { Vpn } from './endpoints/vpn.js'; @@ -133,6 +134,10 @@ export class GleSYSAPI { return new ServerDisk(this.request); } + get shipment() { + return new Shipment(this.request); + } + get sshKey() { return new Sshkey(this.request); } diff --git a/test/endpoints/shipment.js b/test/endpoints/shipment.js new file mode 100644 index 0000000..7f5fda3 --- /dev/null +++ b/test/endpoints/shipment.js @@ -0,0 +1,54 @@ +import { Shipment } from '../../lib/endpoints/shipment.js'; +import { Request } from '../../lib/request.js'; + +describe('endpoints/shipment', () => { + let request; + let shipment; + + beforeEach(() => { + request = new Request(); + shipment = new Shipment(request); + }); + + test('cancel()', () => { + const spy = globalThis.setupRequestSpy(request, 'post'); + const data = { + key: 'abc123', + }; + + shipment.cancel(data); + + expect(spy).toHaveBeenCalledWith('/shipment/cancel', data); + }); + + test('create()', () => { + const spy = globalThis.setupRequestSpy(request, 'post'); + const data = { + datacenter: 'Falkenberg', + }; + + shipment.create(data); + + expect(spy).toHaveBeenCalledWith('/shipment/create', data); + }); + + test('edit()', () => { + const spy = globalThis.setupRequestSpy(request, 'post'); + const data = { + key: 'abc123', + trackingid: 'XYZ789', + }; + + shipment.edit(data); + + expect(spy).toHaveBeenCalledWith('/shipment/edit', data); + }); + + test('list()', () => { + const spy = globalThis.setupRequestSpy(request, 'get'); + + shipment.list(); + + expect(spy).toHaveBeenCalledWith('/shipment/list'); + }); +}); diff --git a/test/glesys.js b/test/glesys.js index 33ec0d6..d3fa223 100644 --- a/test/glesys.js +++ b/test/glesys.js @@ -39,6 +39,7 @@ describe('GleSYSAPI', () => { expect(glesys.remoteHands).toBeDefined(); expect(glesys.server).toBeDefined(); expect(glesys.serverDisk).toBeDefined(); + expect(glesys.shipment).toBeDefined(); expect(glesys.sshKey).toBeDefined(); expect(glesys.user).toBeDefined(); expect(glesys.vpn).toBeDefined();