4.3.11 • Published 5 years ago

nodehandler-utils v4.3.11

Weekly downloads
409
License
SEE LICENCE IN LI...
Repository
-
Last release
5 years ago

nodehandler-utils

nodehandler utils

API Reference

Example (Quick start)

 const { NodeHandlerUtils } = require('nodehandler-utils');
 const { FlowManager } = require('axway-flow');
 const uri = FlowManager.formatNodeHandlerUri('service-connector', 'thing');
 const swagger = require('./thing.json');
 const schemas =  NodeHandlerUtils.exportSchemas(swagger, 'thing');
 const spec =  NodeHandlerUtils.swaggerToNodeHandlerSpec(swagger, 'thing', uri, 'thing-icon');
 const icon = NodeHandlerUtils.loadIcon('icon.png');

nodehandler-utils~NodeHandlerUtils

Node handler utils

Kind: inner class of nodehandler-utils Access: public

NodeHandlerUtils.getSwaggerMethodAsProperties(swagger, name, verb, path) ⇒ object

Converts the swagger parameters to json-schema properties.

Kind: static method of NodeHandlerUtils Returns: object - schema property Access: public

ParamTypeDescription
swaggerobjectswagger doc
namestringThe name of the node handler
verbobjectthe method verb
pathobjectthe method path under swagger.paths

NodeHandlerUtils.swaggerToNodeHandlerSpec(swagger, scope, uri, icon) ⇒ object

Converts a swagger definition to a flow-node spec. The uri uniquely identifies the flow-node, e.g. nodehandler://service-connector/foo (see FlowManager.formatNodeHandlerUri).

Kind: static method of NodeHandlerUtils Returns: object - flow-node spec Access: public

ParamTypeDescription
swaggerobjectThe swagger document to convert
scopestringThe flow-node scope used in schema references
uristringThe unique uri of the flow-node
iconstringThe flow-node's icon (defaults to glyphicon-link).

NodeHandlerUtils.exportSchemas(swagger, scope) ⇒ array

Exports schema from a swagger document. Before returning, all of the references are rewritten to an axway-schema type reference, and identifiers are applied to each schema.

Kind: static method of NodeHandlerUtils Returns: array - An array of schemas. Access: public

ParamTypeDescription
swaggerobjectThe swagger document to use to register schemas
scopestringThe flow-node scope used in schema references

NodeHandlerUtils.loadIcon(file) ⇒ Promise.<string>

Loads an icon file and returns it as a data URI. Supports bmp, jpeg, jpg, png, gif, tiff, and svg.

Kind: static method of NodeHandlerUtils Returns: Promise.<string> - The icon data URI.

ParamTypeDescription
filestringThe icon file to load.

NodeHandlerUtils.formatNodeHandlerUri(module, type) ⇒ string

Formats a nodehandler URI.

Kind: static method of NodeHandlerUtils Returns: string - The formatted URI.

ParamTypeDescription
modulestringA module name for scope, e.g. "twilio".
typestringA simple URL safe type name, e.g. "echo".

nodehandler-utils~generateFunctionName(swpath, method) ⇒ string

Method to create custom operationID-like operation id. Taken from connectors team NOTE: duplicated from code from arrow-admin-api/src/util.js,

Kind: inner method of nodehandler-utils Returns: string - The custom operationID

ParamTypeDescription
swpathstringThe swagger path (eg. /thing)
methodstringThe swagger method/verb (eg. "GET")

Building

npm run build

Author

Axway support@axway.com https://axway.com

Changes

4.3.10

  • #6116: Internal cleanup chore.

4.3.9

  • #6114: Refactor code for style, security and performance improvements.

4.3.8

  • #6074: Internal CI chore

4.3.7

  • #5711: Internal cleanup of npm scripts.

4.3.6

  • #5708: Internal changes to get rid of generating readme if unnecesarry.

4.3.5

  • #5708: Internal changes to update mocha configuration.

4.3.4

  • #5707: Internal cleanup to code coverage during build process.

4.3.3

  • #5552: Exported metadata contains only methods metadata and no longer contains URI metadata.

####4.3.2

  • #5653: Added integration test case for Swagger with circular references.

####4.3.1

  • #5622: Update documentation for "Decode Response" parameter.

4.3.0

  • #5630: Add support for multipart/form-data in Content Type parameter. multipart/form-data will be prioritised as a default value if the Swagger method has formData fields of type file.
  • #5630: Add an enum property choice of application/wwww-form-urlencoded and multipart/form-data to Content Type parameters when Swagger method has formData parameters which are not type file and do not define consumes.
  • #5630: Change the default value for Content Type parameters to application/wwww-form-urlencoded, falling back to multipart/form-data and then the first consumes value when either values exist inside the Swagger method's consumes.
  • #5640: Fix issue where charset is stripped from the default value for Content Type parameters in some cases.

4.2.0

  • #5432: It now adds additional information for formData parameters while converting the swagger parameters to json-schema properties

4.1.0

  • #5432: It now respects swagger consumes and produces properties while converting swagger definitions to flow node specs

4.0.0

  • #4919: Now exports spec and metadata
  • #4918: Breaking Change: Adds authorizations to the spec
  • #5358: Breaking Change: A Default output is created for all flow-nodes regardless of the swagger definition.
  • #5358: Breaking Change: An Error output is created for all flow-nodes to allow routing on connection errors.
  • #5358: The default JSONPath selector for all outputs is now $.response. Only the Error output defaults to $.error.

3.0.11

  • #5111: Fixed bug where swagger documents with extensions in the same location as path methods failed to load correctly.

3.0.10

  • #5112: Previously, schemas generated from a swagger document with no "definitions" section was returned as undefined. Now, an empty array will be returned instead.

3.0.3

  • #4757: Changed SCM repository and associated internal cleanup.
  • #4860: Previously, api-builder-plugin-fn-swagger would throw "Error: Invalid reference token" when attempting to handle URI encoded JSON schema references in Swagger files. Now, invalid reference errors are not thrown.

License

This code is proprietary, closed source software licensed to you by Axway. All Rights Reserved. You may not modify Axway’s code without express written permission of Axway. You are licensed to use and distribute your services developed with the use of this software and dependencies, including distributing reasonable and appropriate portions of the Axway code and dependencies. Except as set forth above, this code MUST not be copied or otherwise redistributed without express written permission of Axway. This module is licensed as part of the Axway Platform and governed under the terms of the Axway license agreement (General Conditions) located here: https://support.axway.com/en/auth/general-conditions; EXCEPT THAT IF YOU RECEIVED A FREE SUBSCRIPTION, LICENSE, OR SUPPORT SUBSCRIPTION FOR THIS CODE, NOTWITHSTANDING THE LANGUAGE OF THE GENERAL CONDITIONS, AXWAY HEREBY DISCLAIMS ALL SUPPORT AND MAINTENANCE OBLIGATIONS, AS WELL AS ALL EXPRESS AND IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO IMPLIED INFRINGEMENT WARRANTIES, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, AND YOU ACCEPT THE PRODUCT AS-IS AND WITH ALL FAULTS, SOLELY AT YOUR OWN RISK. Your right to use this software is strictly limited to the term (if any) of the license or subscription originally granted to you.

4.3.11

5 years ago

4.3.10

6 years ago

4.3.9

6 years ago

4.3.8

6 years ago

2.2.13

6 years ago

4.3.7

6 years ago

4.3.6

6 years ago

4.3.5

6 years ago

4.3.4

6 years ago

4.3.3

6 years ago

4.3.2

6 years ago

4.3.1

6 years ago

4.3.0

6 years ago

4.2.1

6 years ago

4.2.0

6 years ago

4.1.0

6 years ago

2.2.12

6 years ago

2.2.11

6 years ago

2.2.10

6 years ago

2.2.9

6 years ago

4.0.3

6 years ago

4.0.2

6 years ago

4.0.1

7 years ago

4.0.0

7 years ago

2.2.7

7 years ago

2.2.5

7 years ago

2.2.4

7 years ago

3.0.11

7 years ago

3.0.10

7 years ago

3.0.9

7 years ago

3.0.8

7 years ago

3.0.7

7 years ago

3.0.6

7 years ago

3.0.5

7 years ago

3.0.4

7 years ago

3.0.3

7 years ago

3.0.2

7 years ago

3.0.1

7 years ago

3.0.0

7 years ago

3.0.0-10

7 years ago

3.0.0-9

7 years ago

2.1.1

7 years ago

3.0.0-8

7 years ago

3.0.0-7

7 years ago

3.0.0-6

7 years ago

3.0.0-5

7 years ago

3.0.0-4

7 years ago

3.0.0-3

7 years ago

3.0.0-2

7 years ago

3.0.0-1

7 years ago

2.1.1-5

7 years ago

2.1.1-4

7 years ago

2.1.1-3

7 years ago

2.1.1-2

7 years ago

2.1.1-1

7 years ago

2.1.1-0

7 years ago

2.1.0

7 years ago

2.0.3-106

7 years ago

2.0.3-105

7 years ago

2.0.3-104

7 years ago

2.0.3-103

7 years ago

2.0.3-102

7 years ago

2.0.3-101

7 years ago

2.0.2

8 years ago

2.0.1

8 years ago