Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

stacket

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stacket

Interact with the Stacket api

  • 1.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

Stacket-API

Build powerful systems integrating your services together like never before.

Creating a client

import Stacket from "stacket";
//OR
const Stacket = require("stacket").default;

const client = new Stacket("auth-token");

client.verify().then(() => {
    console.log("Authenticated with Stacket");
}).catch(console.error);

Create service

client.createService({
    "type": "minecraft",
    "node": "fsn10",
    "package": "pkg1",
    "platform": "spigot",
    "version": "1.8.8"
}).then(service => {
    console.log(service);
}).catch(console.error);

Rename service

let serviceId = "5ef951de74eb7027994b585b";
client.getService(serviceId).then(service => {
    service.setName("New service name!");
}).catch(console.error);

Delete service

let serviceId = "5ef951de74eb7027994b585b";
client.getService(serviceId).then(service => {
    service.delete();
}).catch(console.error);

Create network

client.createNetwork({
    "name": "Test Network",
    "type": "ipv6"
}).then(network => {
    console.log(network);
}).catch(console.error);

Rename network

let networkId = "5ea5d1f9c2c50957ceae7dfb";
client.getNetwork(networkId).then(network => {
    network.setName("New network name!");
}).catch(console.error);

Delete network

let networkId = "5ea5d1f9c2c50957ceae7dfb";
client.getNetwork(networkId).then(network => {
    network.delete();
}).catch(console.error);

Create Drive

client.createDrive({
    "name": "Test Drive",
    "size": 250 // Specified in GB
}).then(drive => {
    console.log(drive);
}).catch(console.error);

Rename Drive

let driveId = "5ef5f7e771cdd7625a303da6";
client.getDrive(driveId).then(drive => {
    drive.setName("New drive name!");
}).catch(console.error);

Resize Drive

let driveId = "5ef5f7e771cdd7625a303da6";
client.getDrive(driveId).then(drive => {
    drive.setSize(500);
}).catch(console.error);

Delete Drive

let driveId = "5ef5f7e771cdd7625a303da6";
client.getDrive(driveId).then(drive => {
    drive.delete();
}).catch(console.error);

Create Folder

client.createFolder({
    "name": "Test Folder",
    "disks": [],
    "networks": [],
    "services": ["5ef951de74eb7027994b585b"]
});

Rename Folder

let folderId = "5f177a83e355067a6dfa037a";
client.getFolder(folderId).then(folder => {
    folder.setName("New folder name!");
}).catch(console.error);

Add Item to Folder

let folderId = "5f177a83e355067a6dfa037a";
client.getFolder(folderId).then(folder => {
    folder.addItem({"id": "5ef951de74eb7027994b585b", "type": "service"});
}).catch(console.error);

Remove Item from Folder

let folderId = "5f177a83e355067a6dfa037a";
client.getFolder(folderId).then(folder => {
    folder.removeItem({"id": "5ef951de74eb7027994b585b", "type": "service"});
}).catch(console.error);

Delete Folder

let folderId = "5f177a83e355067a6dfa037a";
client.getFolder(folderId).then(folder => {
    folder.delete();
}).catch(console.error);

Keywords

FAQs

Package last updated on 26 Oct 2020

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc