Socket
Socket
Sign inDemoInstall

@skedulo/optimization-manager-client

Package Overview
Dependencies
Maintainers
0
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@skedulo/optimization-manager-client

Client for optimization manager api calls


Version published
Weekly downloads
123
decreased by-25.45%
Maintainers
0
Weekly downloads
 
Created
Source

optimization-manager-client

This package provides a client for the Optimization Manager API. The client is generated from the OpenAPI spec of the Optimization Manager API.

Also included are some Adapter functions to help with common use cases when working with the Optimization Manager API.

Setup

Run yarn install to install the dependencies

Development

Yarn commands:

  • build - Build the package
  • generate - Run generation for the autogenerated client code using the OpenAPI spec from the Optimization Manager API dev environment
  • test - Run the tests

The client will be generated automatically when commits are made to

Usage

Installation

Install @skedulo/optimization-manager-client in your project

npm install @skedulo/optimization-manager-client

OR

yarn add @skedulo/optimization-manager-client

Example

Below is a simple example connected function using ScheduleTransformer to override the Optimization Manager API /schedule endpoint.

import express from 'express';
import {createOptimizationRoutes, TransformerDataShape} from "@skedulo/optimization-manager-client";

import {FunctionRoute, extractAuthorizationInfoFromHeader} from '@skedulo/sdk-utilities'

// tslint:disable-next-line:no-empty-interface
interface RequestPayload {
}

const transform = (data: TransformerDataShape): TransformerDataShape => {
    const resources = data.featureModel.resources.map((resource) => ({
        ...resource,
        maxDailyTravelTimeInMinutes: resource.maxDailyTravelTimeInMinutes * 2,
    }))
    return {...data, featureModel: {...data.featureModel, resources}}
}

export function getRoutes(): FunctionRoute[] {
    return createOptimizationRoutes(transform)
}




FAQs

Package last updated on 25 Sep 2024

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