@medable/mdctl-sandbox

1.0.72 • Public • Published

mdctl-sandbox

Developer Tools Sandbox Module for Medable

This module will let you run scripts into the Medable's sandbox.

Usage

const { Client } = require('@medable/mdctl-api'),
      sandbox = require('@medable/mdctl-sandbox'),
      options = {
        client: new Client({
          strictSSL: false,
          environment: {
            endpoint: 'https://localhost',
            env: 'test'
          },
          credentials: {
            type: 'password',
            apiKey: 'abcdefghijklmnopqrstuv',
            username: 'test@medable.com',
            password: 'password'
          }
        }),
        stats: true,
        body: `
          const sum = (param1, param2) => {
            return param1 + param2
          }
          
          return sum(5,1)
        `,
        arguments: [],
        script: '',
        optimize: false,
        format: 'json'
      },
      response = {}

try {
  Object.assign(response, await sandbox.run(options))
} catch (e) {
  response.err = e.toJSON()
}

console.log(JSON.stringify(response))

Readme

Keywords

none

Package Sidebar

Install

npm i @medable/mdctl-sandbox

Weekly Downloads

409

Version

1.0.72

License

MIT

Unpacked Size

9.37 kB

Total Files

6

Last publish

Collaborators

  • harishva
  • myerkes-md
  • cscherer-md
  • __jacobi
  • jamessas
  • trsmith
  • grobledo
  • oferrero.medable