@skedulo/function-utilities
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

Skedulo Header Parser Utilities

External development utilities for Skedulo Connected Function. This project includes utilities to parse Skedulo specific header to extract Custom Settings, User Context, and Authorization Info. This project is intended to be used only as a dev dependency in package projects because of its dependency on Node and the filesystem.

To develop both the dev public package and the Connected Function template, it's recommended that yarn link is used across projects to test changes locally. For the package, this involves running yarn link at the root and for each boilerplate running yarn link @skedulo/function-header-helper.

Package Development

  • Dependency Installation: yarn
  • Compile the package: yarn compile
  • Release package for local version to NPM: yarn release-package ${versionNumber}

How to use this package in your project

const { method, path, headers, body, querystring } = payload
const skedContext:SkedContext = createSkedContext(headers);

// Get access token and Skedulo API base URL
const token: string = skedContext.auth.apiToken;
const baseUrl: string = skedConText.auth.baseUrl;

// Get the username of the user triggering the function
const userName: string = skedContext.userContext.username;

// Configuration Variables
// This will return the value of TEST_CONFIG variable in your Skedulo configuration. If the variable is not set, the function will return undefined.
const configVar = skedContext.configVars.getVariableValue("TEST_CONFIG")

Readme

Keywords

none

Package Sidebar

Install

npm i @skedulo/function-utilities

Weekly Downloads

423

Version

0.0.3

License

MIT

Unpacked Size

181 kB

Total Files

18

Last publish

Collaborators

  • minhsked
  • jameswarr
  • hha2024
  • tdaosked
  • trangpham
  • skedadmin
  • ghilton
  • son.tieu
  • adtennant
  • willthames_sked
  • ehollonds
  • skedsondang
  • cong.le
  • harryj-skedulo
  • drsk
  • sgassmann
  • sophiewheeler
  • jnovak
  • antran.skedulo
  • sked-dev-uk
  • yurychislov
  • clucas-skedulo
  • zoestewart
  • mnpetersen-skedulo
  • son.bui
  • davidsetyanugraha
  • nedmules
  • dsavagesked
  • leto-skedulo
  • lap.tran
  • tomwright
  • james.bassett
  • bbeuth-skedulo
  • abyerly
  • patsimonsked
  • krystlel
  • edwardsmatt
  • hoangmphung
  • alopez
  • jahrens
  • skeddevvn
  • codeth
  • cuong_skedulo