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

toxeus-node-sdk

Package Overview
Dependencies
Maintainers
1
Versions
102
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

toxeus-node-sdk

toxeus-node-sdk is a JavaScript-based server-side library that lets clients send requests to the Toxeus Solver API to model and solve optimization problems in real-time. The Toxeus Solver API is built on top of the AWS Cloud and uses the AWS Lambda and AW

  • 1.0.6
  • npm
  • Socket score

Version published
Weekly downloads
24
increased by50%
Maintainers
1
Weekly downloads
 
Created
Source

toxeus-node-sdk

toxeus-node-sdk is a JavaScript-based server-side library that lets clients send requests to the Toxeus Solver API to model and solve optimization problems in real-time. The Toxeus Solver API is built on top of the AWS Cloud and uses the AWS Lambda and AWS API Gateway services.

https://s3.console.aws.amazon.com/s3/buckets/toxeus-user-requests?region=us-west-2&tab=objects#

NameDescription
toxeus-sdk-demoGitHub project with example code and demonstrations regarding the usage of the toxeus-node-sdk
toxeus-cloud-platformA customer-facing web platform that provides support for user registration, upgrade account, and generating api keys)
toxeus-user-documentationThe official documentation for Toxeus includes guides for using toxeus-node-sdk, using the Toxeus Cloud Platform, and more.
toxeus-npm-registryThe official source of Toxeus node packages related to the npm registry

Project Structure

NameDescription
.vscodeVSCode settings file that contains linter, formatting tool, etc.
srcContains the main file where the source code of the program is written.
src/authContains methods that authenticate users with AWS Cognito and Amplify via their email and password
src/modelClient and Model classes that contain default parameters and required arguments to match properties sent to the solver handler (Lambda Function)
src/payloadContains functions that check the size of a request payload
src/S3Contains functions to read and write items to an S3 Bucket payload
src/s3-templatesContains request and response templates for s3 events, such as writing an item to s3 (problem file), and writing a request item to an S3 Bucket (solution file)
testA directory that contains all cases of unit tests

Unit Tests

Jest is an open-source Javascript testing framework developed by Facebook. It was mainly built for React, Node, Babel, TypeScript, Angular, Vue, and JavaScript-based applications.

Installation

npm install -- save-dev jest

Unit Tests

The fundamental components of a unit test file are test() and expect(). The test() function is used to describe a unit test case, and the expect() function is used to make assertions.

function.test.js

  test("Describe the function being tested", () => {
   expect(2*2).toBe(4);
   expect(4-2).not.toBe(1);
 })
  • test() - accepts two arguments: (1) a string describing the test case and (2) An anonymous function containing logic of the function being tested.

  • expect() – depending on whether the actual output is equal to the expected output of the function being tested, the test case will either pass or fail, based on the expect() function.

{
  "gigabytes_of_memory_used_by_solver": 4,
  "maximum_acceptable_objective_function_value_difference_from_best_solution_found": 1,
  "maximum_acceptable_error": 10,
  "error_metric": "sum_of_constraint_violations",
  "maximum_number_of_solutions_to_return": 3,
  "maximum_solver_runtime_in_seconds": 3,
  "minimum_acceptable_distance_between_distinct_solutions": 0.01,
  "number_of_starting_points": 2,
  "problem_constraints": [
    { "constraint": "x + y + z <= 10" },
    { "constraint": "x + y + z >= 11" }
  ],
  "problem_description": "FIRST DESCRIPTION",
  "problem_name": "dummy problem name",
  "problem_tags": [{ "tag": "tag1" }, { "tag": "tag2" }],
  "problem_type": "optimization",
  "problem_objective_function": [
    {
      "expression": "(1/x+y+z-3)^2+(x+1/y+z-3)^2+(x+y+1/z-3+0+0)^2",
      "type": "minimize"
    }
  ],
  "problem_variables": [
    {
      "name": "x",
      "type": "continuous",
      "lower_bound": 10,
      "upper_bound": 15,
      "initial_region_to_select_starting_points_from": {
        "lower_bound": 11,
        "upper_bound": 14
      }
    },
    {
      "name": "y",
      "type": "continuous",
      "lower_bound": 0,
      "upper_bound": 0.1,
      "initial_region_to_select_starting_points_from": {
        "lower_bound": 0,
        "upper_bound": 0.05
      }
    },
    {
      "name": "z",
      "type": "continuous",
      "lower_bound": 0,
      "upper_bound": 15,
      "initial_region_to_select_starting_points_from": {
        "lower_bound": 0.1,
        "upper_bound": 10
      }
    }
  ],
  "request_type": "asynchronous"
}

npm i chalk@4.1.2

FAQs

Package last updated on 05 Jan 2023

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