Use the package manager [npm] to install. Run command:
npm install windwardrestapi#Windward RESTful API JavaScript
##Installation
Use the package manager [npm] to install. Run command:
- npm install --save windwardrestapi (to install for a local project)
- npm install -g windwardrestapi (to install globally)
##Usage
Please refer to the sample application to see these methods being used.
Also refer to https://app.swaggerhub.com/apis/Windward-Studios/windward-rest_ful_api/2.0#/ to see the object structure and heirarchy in the client.
``javascript
`
import pkg from 'windwardrestapi';
const {WindwardClient, Template, Xml_10DataSource, OutputFormatEnum} = pkg;
`
###Method and Constructor Declarations
Outline of the code to get a better idea of what the methods and constructors look like in this project.
####WindwardClient Methods
The Windward object constructor takes in the base url for the RESTful engine, and an optional licence key if you want to use a different key:
javascript
`
constructor(baseUrl : string, licKey? :string);
`
#####getVersionInfo
This method returns the version information for the REST engine and the local client.
javascript
`
async getVersionInfo();
`
#####postDocument
This method takes in a Template object and posts it to the engine for processing. Returns Document object.
javascript
`
async postDocument(template : Template);
`
#####getDocumentStatus
This method gets the status of the document as it is being processed by the engine. Takes in a Document object Guid and returns a status code.
javascript
`
async getDocumentStatus(guid: string);
`
#####getDocunment
This method retrieves the generated document after processing. Takes in a Document object Guid and returns a document object.
javascript
`
async getDocument(guid : string);
`
#####deleteDocument
This method deletes a generated document. Takes in a Document object Guid and returns a status code.
javascript
`
async deleteDocument(guid : string);
`
#####postMetrics
This method takes in a Template object and posts it to the engine to get metrics. Returns Metrics object.
javascript
`
async postMetrics(template : Template);
`
#####getMetricsStatus
This method gets the status of the metrics as it is being processed by the engine. Takes in a Metrics object Guid and returns a status code.
javascript
`
async getMetricsStatus(guid: string);
`
#####getMetrics
This method retrieves the generated metrics after processing. Takes in a Metrics object Guid and returns a metrics object.
javascript
`
async getMetrics(guid : string);
`
#####deleteMetrics
This method deletes a generated metrics. Takes in a Metrics object Guid and returns a status code.
javascript
`
async deleteMetrics(guid : string);
`
#####postTagtree
This method takes in a Template object and posts it to the engine to get the tag tree of tags in the template. Returns TagTree object.
javascript
`
async postTagTree(template : Template);
`
#####getTagTreeStatus
This method gets the status of the tag tree as it is being processed by the engine. Takes in a TagTree object Guid and returns a status code.
javascript
`
async getTagTreeStatus(guid: string);
`
#####getTagTree
This method retrieves the generated tag tree after processing. Takes in a TagTree object Guid and returns a Tagtree object.
javascript
`
async getTagTree(guid : string);
`
#####deleteTagTree
This method deletes a generated tag tree. Takes in a TagTree object Guid and returns a status code.
javascript
`
async deleteTagTree(guid : string);
`
####Datasource Constructors
The constructors for the Datasource objects.
#####Base DataSource Constructor
javascript
`
constructor(name : string, type : string, className? : string, connectionString? : string,
schemaConnectionString? : string, data? : string, schemaData? : string, datasets? : DataSet[])
`
#####JsonDatasSource Constructor
javascript
`
constructor(name: string, connectionString?: string, data?: string, type : DatasourceTypeEnum = DatasourceTypeEnum.JSON)
`
#####ODataDataSource Constructor
javascript
`
constructor(name: string, connectionString: string, type : DatasourceTypeEnum = DatasourceTypeEnum.ODATA)
`
#####SalesforceDataSource Constructor
javascript
`
constructor(name: string, connectionString: string, type : DatasourceTypeEnum = DatasourceTypeEnum.SALESFORCE)
`
#####SalesforceOAuthDataSOurce Constructor
javascript
`
constructor(name: string, connectionString: string, type : DatasourceTypeEnum = DatasourceTypeEnum.SALESFORCEOAUTH)
`
#####SqlDataSource Constructor
javascript
`
constructor(name: string, connectionString?: string, data?: string, type : DatasourceTypeEnum = DatasourceTypeEnum.SQL)
`
#####Xml_10DataSource Constructor
javascript
`
constructor(name: string, connectionString?: string, data? : string, schemaConnectionString?: string, type : DatasourceTypeEnum = DatasourceTypeEnum.XML)
`
#####Xml_20DataSource Constructor
javascript
`
constructor(name: string, connectionString?: string, schemaData? : string, schemaConnectionString?: string, type : DatasourceTypeEnum = DatasourceTypeEnum.XML2)
`
####Template Constructor
javascript
``
constructor(outputFormat : OutputFormatEnum, datasources : DataSource[], callback? : string, data? : string, connectionString? : string, format? : string, properties? : Property[],
parameters? : Parameter[], tag? : string, trackImports? : boolean, trackErrors? : number, mainPrinter? : string,
firstPagePrinter? : string, printerJobName? : string, printCopies? : number, printDuplex? : string)