@openfn/language-maximo
TypeScript icon, indicating that this package has built-in type declarations

0.4.1 • Public • Published

Language Maximo

Language Pack for building expressions and operations to access IBM Maximo EAM.

Documentation

Configuration

View all the required and optional properties for state.configuration in the official configuration-schema definition.

Fetch

sample 'fetch' expression

fetch({
  endpoint: 'maxrest/rest/os/mxinventory',
  query: {
    ITEMNUM: '01226',
    _format: 'json',
  },
  postUrl: 'https://www.openfn.org/inbox/not-real',
});

sample 'create' expression

create({
  endpoint: 'maxrest/rest/os/mxinvbal/',
  body: function (state) {
    return {
      ITEMNUM: dataValue('form.ITEMNUM')(state),
      ITEMSETID: dataValue('form.ITEMSETID')(state),
      SITEID: dataValue('form.SITEID')(state),
      LOCATION: dataValue('form.LOCATION')(state),
      ISSUEUNIT: 'FOO',
      PHYSCNT: dataValue('PHYSCNT')(state),
      BINNUM: dataValue('form.BINNUM')(state),
    };
  },
});

sample 'update75' expression

update75({
  endpoint: state => {
    return (
      'maxrest/rest/os/mxinvbal/' +
      dataValue('form.question1.INVBALANCESID')(state)
    );
  },
  body: state => {
    return {
      _action: 'AddChange', //this is required for the old Maximo API!
      ITEMNUM: dataValue('form.ITEMNUM')(state),
      ITEMSETID: dataValue('form.ITEMSETID')(state),
      SITEID: dataValue('form.SITEID')(state),
      LOCATION: dataValue('form.LOCATION')(state),
      PHYSCNT: dataValue('form.PHYSCNT')(state),
      BINNUM: dataValue('form.BINNUM')(state),
    };
  },
});

Development

Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

Run tests using pnpm run test or pnpm run test:watch

Build the project using pnpm build.

To just build the docs run pnpm build docs

Readme

Keywords

none

Package Sidebar

Install

npm i @openfn/language-maximo

Weekly Downloads

1

Version

0.4.1

License

LGPLv3

Unpacked Size

78.4 kB

Total Files

10

Last publish

Collaborators

  • mtuchi
  • elias-ba
  • stuartc-openfn
  • taylordowns2000