Skip to content

Commit

Permalink
Merge pull request #2 from ingrammicro/develop
Browse files Browse the repository at this point in the history
First public release
  • Loading branch information
marcserrat committed Dec 9, 2019
2 parents aff0ee3 + eeb60e8 commit 366b843
Show file tree
Hide file tree
Showing 46 changed files with 9,049 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"env": {
"browser": true,
"commonjs": true,
"es6": true,
"node": true
},
"extends": [
"airbnb-base"
],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"ecmaVersion": 2018
},
"rules": {
"no-underscore-dangle": "off"
},
"ignorePatterns": ["test/", "node_modules/"]
}
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
build
node_modules
*.log
.environment
.env
.nyc_output
coverage
docs/build
15 changes: 15 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
language: node_js
node_js:
- 8
- 10
- 12
script:
- npx nyc --reporter=lcov npm test && npx codecov
deploy:
provider: npm
email: francesco.faraone@ingrammicro.com
api_key:
secure: bvwJdcv8VEOyC1g91tsvYdkvar9EaLG4KJk4Z1mAzjcgRQxZ+h2Oo8QHhuZyaFlfulqv1kF2dxIrSV9ezcVnRhS4gH6GGR1hlkTtzm2i2dOAyQ031/hFzuJNDH3elKz+McdqKso95ZlMqoG1H2pFErhgef/y/HLM5hraTVuTHjbpolBf24B2aMQ6HW6rRGnnAW3OsbnDOrfVWYSkK1ntK4vNNixwWLhTCuffZvMbA4dLrsnUp5AN+ytVqL5BGNaNToojfo23Qk3I4ojEjVYH3VhWMQm/dmGyiZ93cP9EeHjWkIHpIEmBjUz+seLcEtcIacmHJKL51CMzzvusvEUEqLveEoXEuTz88SCAwa8SaOH7lkPqGUWWfhMv7H2+ly/7o5lIy4LL1hjTUEQAikV5blcAiJCoLv5l2l7oTAHKpK3Ws0yiB+POF2bA3HZJm/7dh3eeN2fxzT8Qh8sQY4FK0NiS2RPk8YwJP3I0q4wRYtRGpN+NmaRsiUjX9l/raYv4RMfSNn/S94PeUrmNEPGNOa0MAno7HI4PiLfugljpd0wApjzgCpMLlCfj/LTV23wqD8/EmFa0XGlfWyRkbAzDvK/D70HmOsQRelxp5Q2SB8hCL6HA+nD2qsh7NbcJASk0fxZ/pnaMd9qRWjNTjLrjoGEz3F6UIC5eSNKVwSMvyqU=
on:
repo: ingrammicro/connect-javascript-sdk
branch: master
89 changes: 89 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# Connect Javascript SDK

CloudBlue Connect is a supply automation platform that manages your products and services, contracts,
ordering and fulfillment, usage and subscriptions.

It supports any product, from physical goods to cloud products, as well as any channel, including your
direct and indirect sales channels and internal procurement.

With its flexible APIs, it can connect to any commerce platform.

Vendors can leverage CloudBlue Connect to:

* Reduce the total cost of ownership for homegrown technology supporting their indirect channel
* Standardize integrations with partners
* Increase efficiencies and minimize redundancies by bridging their direct and indirect sales channels

Service providers can use CloudBlue Connect to:

* Define, manage and distribute any type of product (omni-product) through any channel (omni-channel)
* Transform perpetual licensed products into a subscription model
* Onboard new products into their portfolio quickly to build and deliver unique solutions to end customers


Connect Javascript SDK allows an easy and fast integration with the Cloud Blue Connect Platform.
Thanks to it you can automate the fulfillment of orders generated by your products.



## Dependencies

Connect Javascript SDK work with Node.js version 8 or later.

Connect Javascript SDK also depends on:

* [lodash](https://lodash.com/) version 4.17.15
* [node-fetch](https://www.npmjs.com/package/node-fetch) version 2.6.0


## Install

To install the Connect Javascript SDK from a terminal window type:

```sh
$ npm install --save @cloudblueconnect/connect-javascript-sdk
```

## Documentation

The full SDK documentation is available [here](https://connect-javascript-sdk.readthedocs.io/).


## Usage

### Obtain the API endpoint and an API key

Before you start, you must obtain the API endpoint URL and an API key to access the Cloud Blue Connect Public API.

Go to your portal, from the navbar menu choose the `API` module.

In the `General` section you can find your API endpoint.

In the left side menu, choose `Tokens` to go to the API token view.

Once in the `Token` view, click on the button `CREATE TOKEN` on the upper right corner of the view.

### Example

```js

// import the ConnectClient class
const { ConnectClient } = require('@cloudblueconnect/connect-javascript-sdk');

// create an instance of the ConnectClient class
const client = new ConnectClient('https://<your api endpoint>/', '<your api key>');

// get a list of the latest version of publishd products
const products = await client.products.list();
```

## Contribute

If you want to contribute to the Connect Javascript SDK development feel free to open issues or fork the github repository and submit your pull request.


## License

The Connect Javascript SDK is licensed under the [*Apache License 2.0*](http://www.apache.org/licenses/LICENSE-2.0).


20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
2 changes: 2 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Sphinx==2.2.1
sphinx-js==2.8
68 changes: 68 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
import os
import sphinx_rtd_theme

on_rtd = os.environ.get('READTHEDOCS') == 'True'
# -- Project information -----------------------------------------------------

project = 'Connect Javascript SDK'
copyright = '2019, Ingram Micro Inc'
author = 'Ingram Micro Inc'

# The full version, including alpha/beta/rc tags
release = '19.0.0'


# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx_js',
'sphinx_rtd_theme'
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []

master_doc = 'index'

# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'
html_logo = 'images/connect_logo_fullname.png'

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']

# sphinx-js configuration
jsdoc_config_path = './jsdoc.conf.json'
js_source_path = '../lib'
if on_rtd:
js_source_path = '../../lib'
primary_domain = 'js'
49 changes: 49 additions & 0 deletions docs/source/getting_started.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
Getting started
===============

Requirements
------------

The Cloud Blue Connect Javascript SDK depends on the following 3rd party packages:

* `lodash <https://lodash.com/>`_ version 4.17.15
* `node-fetch <https://www.npmjs.com/package/node-fetch>`_ version 2.6.0

Installation
------------

The current stable release of the Connect Javascript SDK is |release|.

To install the Connect Javascript SDK at the command prompt enter:

.. code-block:: sh
$ npm install @cloudblueconnect/connect-javascript-sdk --save
Usage
-----

Create an instance of the `ConnectClient` class:

.. code-block:: js
const { ConnectClient= require('@cloudblueconnect/connect-javascript-sdk');
const client = new ConnectClient('<api_endpoint>', '<api_key>');
The `ConnectClient` groups operations by the resource they access.
For example to invoke the list operation for the `Product` resource:

.. code-block:: js
client.products.list()
.then(products => { console.log(products) });
Or if you prefer the async/await syntax:

.. code-block:: js
const products = await client.products.list();
console.log(products);
Binary file added docs/source/images/connect_logo_fullname.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
65 changes: 65 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
.. Connect Javascript SDK documentation master file, created by
sphinx-quickstart on Mon Dec 2 09:17:41 2019.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
.. |trade| unicode:: U+2122
.. |copy| unicode:: U+00A9
.. |year| date:: %Y

Welcome to Cloud Blue Connect |trade| Javascript SDK's documentation!
=====================================================================

Introduction
------------

CloudBlue Connect is a supply automation platform that manages your products and services, contracts,
ordering and fulfillment, usage and subscriptions.

It supports any product, from physical goods to cloud products, as well as any channel, including your
direct and indirect sales channels and internal procurement.

With its flexible APIs, it can connect to any commerce platform.

Vendors can leverage CloudBlue Connect to:

* Reduce the total cost of ownership for homegrown technology supporting their indirect channel
* Standardize integrations with partners
* Increase efficiencies and minimize redundancies by bridging their direct and indirect sales channels

Service providers can use CloudBlue Connect to:

* Define, manage and distribute any type of product (omni-product) through any channel (omni-channel)
* Transform perpetual licensed products into a subscription model
* Onboard new products into their portfolio quickly to build and deliver unique solutions to end customers


The Cloud Blue Connect Javascript SDK helps developers to integrate your commerce platform with Cloud Blue Connect.


Table of contents
-----------------


.. toctree::
:maxdepth: 2

getting_started
reference



Indices and tables
------------------

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`


License
-------

|copy| |year| Ingram Micro Inc. All right reserved.

The Connect Javascript SDK is licensed under the `Apache License 2.0 <http://www.apache.org/licenses/LICENSE-2.0>`_.
10 changes: 10 additions & 0 deletions docs/source/jsdoc.conf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"source": {
"includePattern": ".+\\.js(doc|x)?$",
"excludePattern": "(^|\\/|\\\\)_"
},
"opts": {
"explain": true,
"recurse": true
}
}

0 comments on commit 366b843

Please sign in to comment.