ih-ps-connector
v2.0.0-alpha.4
Published
A PeopleSoft Connector for IH
Downloads
43
Readme
ih-ps-connector
A Connector for an Ih
project designed for use with PeopleSoft
Installation
npm i ih-ps-connector
Usage
This project provides several methods that can be used to communicate with PeopleSoft architectures. The methods provide an interface that makes constructing the request parameters for PeopleSoft web service calls much easier and handles serializing and formatting the response object that comes back.
Most calls follow the same general formula:
IhPsConnector.someWebService(requestParams: Object, ...otherParams: <?>, Model: Function): Promise<Model|Fault>
requestParams
The requestParams
object contains the information required to make the actual call. An example might look like:
var requestParams = {
url: 'someRequestUrl',
auth: ['username', 'password'],
headers: {
someHeader: 'someValue',
someOtherHeader: 'someOtherValue'
}
}
...otherParams
The ...otherParams
are additional parameters that might be used to construct the request object. Not all of the methods require these and most of the ones that do provide defaults that are used if they aren't specified.
Model
The Model
is a function that tells the method how to format the data that comes back in the response. All of the default Models, with the exception of Schedule
, take a single parameter obj
that is a serialized response object and returns an object that contains the formatted response data.
Note about serializing
PeopleSoft responses objects are generally string representations of an XML object containing all-caps, snake-cased key names. This project first translates that response into a valid JS object, and then transforms all the keys into camel-case. This object is what is passed to the Model provided to the call.
Making Changes
For those of you who have forked this repository, see the Changes Documentation for details on how to make your own changes to the code.