Neverending Package Mountain

    connector-builder

    1.1.2 • Public • Published

    Connector Builder

    CLI tool for Connector Generation.

    Generates API-First Connectors with a specified name based on provided API definition.

    API-First Connector is an SDK that expose a set of functions for communiaction with third party API.

    Table of Contents

    How To Install?

    Prerequisites

    Both the CLI and generated project have dependencies that require Node 8.9.1 or higher, together with NPM 5 or higher.

    Installation

    • Install globally connector-builder
    npm i connector-builder -g

    NOTE: if you have any issue due to the installation process, you can use sudo command. It is needed in case of installing npm modules in default folders that need permission. You may need to fill your administrator password. Please find additional information on the following link sudo

    As a result you should have connector-builder command in your terminal.

    How to Update the CLI

    If you're using old CLI version, you need to uninstall connector-builder package and to install it globally again:

    npm uninstall -g connector-builder
    npm install -g connector-builder

    How to Generate Connector?

    To list the available options run:

    connector-builder h

    Using Interactive Wizard

    connector-builder i

    Will start a step by step wizard for filling the necessary information for connector generation.

    Steps

    • Provide the name of the connector you want to generate - the naming convention is to use appc. like prefix and lowercase letters e.g. appc.mynewconnector
    • Provide the URL or the path (absolute or relative) to the API definition - e.g. /Users/Documents/swagger.json
    • Select the Connector Type - there are two given options Cloud Elements or Open API.
    • Select the Context - there are two given options API Builder or Plain JS. Selecting the first one means that the connector is going to be used within API Builder and the second one means that the connector is going to be used in plain javascript application.
    • Enter the absolute path to the location where the connector will be generated (leave empty for current dir) - by default the connector will be generated in your current directory in its own folder otherwise you could specify the location where the connector must be generated.
    • Do you want to remove previous connector if it is already exist - there are two options Y/N

    After the above steps you will have successfully generated connector.

    Manual Usage

    Available is a second approach for the generation of a new connector. You need to set all required parameters and connector type. Please find the examples below.

    Mandatory Parameters

    name - the connector name

    api - path or URL to the API definition

    Optional Parameters

    type - defines the specifics of API definition and how the connector talks to the underlying service. Please find available connector types below.

    context - defines where the connector will be used - API Builder application or Plain JavaScript program. Default choice is API Builder application.

    dest - the absolute path to the directory where the connector will be generated

    Available Connector Types

    openapi - generates connector based on Open API Definitions and standard HTTP communication mechanism

    Examples of the generation options

    Valid flag values:

    • --name - the connector name. Cannot be an empty string, space or cannot have unallowed special characters except ., -, _.
    • __api - url or path to the swagger definition file (absolute or relative)
    • --type - describe the type of the service connector. Two available options: ce (Cloud Elements connector) or openapi (Open API Definitions)

    Generation options:

    • standard generation with no overwrite in the current directory:
    connector-builder --name [Connector Name] --api [Path or URL to the API Definition] --type [Connector Type]
    • standard generation with overwrite in the current directory:
    connector-builder --name [Connector Name] --api [Path or URL to the API Definition] --type [Connector Type] --force
    • generation with default connector type with no overwrite in the current directory:
    connector-builder --name [Connector Name] --api [Path or URL of the API Definition]
    • generation with default connector type with overwrite in the current directory:
    connector-builder --name [Connector Name] --api [Path or URL of the API Definition] --force
    • generation with default connector type with no overwrite in specified directory:
    connector-builder --name [Connector Name] --api [Path or URL of the API Definition] --dest [Absolute Path]

    How To Refresh Connector?

    If you need to generate the connector again due to changes or if there is more recent versions of your API, please update the content of config/swagger.json file and you can regenerate it via refresh functionality. You won't lose any test data from your Test Suite. Please follow the steps below:

    • navigate to the root directory of the connector
    • execute the refresh command
    connector-builder refresh
    

    As a result, you should have successfully regenerated connector

    Supported API Definitions

    Currently supported standards are:

    The files describing the RESTful API in accordance with the Swagger specification are represented as JSON objects and conform to the JSON standards

    Author

    Axway R&D support@axway.com https://axway.com

    License

    This code is closed source and Confidential and Proprietary to Axway, Inc. All Rights Reserved. This code MUST not be modified, copied or otherwise redistributed without express written permission of Axway. This file is licensed as part of the Axway Platform and governed under the terms of the Axway license agreement. Your right to use this software terminates when you terminate your Axway subscription.

    Install

    npm i connector-builder

    DownloadsWeekly Downloads

    5

    Version

    1.1.2

    License

    none

    Last publish

    Collaborators

    • ddimonov-axway
    • axway_darnaudov
    • nkeranova
    • axway-npm
    • cb1kenobi
    • jamie.peabody
    • awam
    • bladedancer
    • neon-axway
    • vchauhan
    • mdimitrova
    • pdzhorev
    • axway_alasdair
    • pltod2
    • npetrovski-axway
    • pbozhkovaxway
    • mbonchev-axway
    • axway-vertex
    • cdobrica