npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

nodehandler-utils

v4.3.11

Published

nodehandler utils

Downloads

438

Readme

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

| Param | Type | Description | | --- | --- | --- | | swagger | object | swagger doc | | name | string | The name of the node handler | | verb | object | the method verb | | path | object | the 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

| Param | Type | Description | | --- | --- | --- | | swagger | object | The swagger document to convert | | scope | string | The flow-node scope used in schema references | | uri | string | The unique uri of the flow-node | | [icon] | string | The 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

| Param | Type | Description | | --- | --- | --- | | swagger | object | The swagger document to use to register schemas | | scope | string | The 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.

| Param | Type | Description | | --- | --- | --- | | file | string | The icon file to load. |

NodeHandlerUtils.formatNodeHandlerUri(module, type) ⇒ string

Formats a nodehandler URI.

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

| Param | Type | Description | | --- | --- | --- | | module | string | A module name for scope, e.g. "twilio". | | type | string | A 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

| Param | Type | Description | | --- | --- | --- | | swpath | string | The swagger path (eg. /thing) | | method | string | The swagger method/verb (eg. "GET") |

Building

npm run build

Author

Axway [email protected] 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.