Skip to content
Node.js library for the JWPlatform Management API
JavaScript Makefile Dockerfile
Branch: master
Clone or download
boyntoni Implement upload method (#10)
* Initial implementation for  upload method

* Implement single upload method

* Remove node-fetch

* Bump the version in package.json

* Update per feedback:

* Use different test video
Latest commit 28c0ab7 Nov 23, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples Implement upload method (#10) Nov 23, 2019
jwplatform Implement upload method (#10) Nov 23, 2019
test Implement upload method (#10) Nov 23, 2019
.eslintrc.js JWPlatformAPI client (#1) Oct 30, 2019
.gitignore JWPlatformAPI client (#1) Oct 30, 2019
.npmignore Use .npmignore, not .npmrc (#4) Oct 31, 2019
.prettierrc JWPlatformAPI client (#1) Oct 30, 2019
Dockerfile JWPlatformAPI client (#1) Oct 30, 2019
LICENSE
Makefile JWPlatformAPI client (#1) Oct 30, 2019
README.md Implement upload method (#10) Nov 23, 2019
package.json Implement upload method (#10) Nov 23, 2019
yarn.lock Implement upload method (#10) Nov 23, 2019

README.md

JW Platform API

Node client for interfacing with the JW Platform management API.

Note that this is not developed for client side use, as it requires your API Key and Secret. For your own security, please restrict usage to server side applications.

Install

Install the package with:

yarn add jwplatform

Example Usage

const JWPlatformAPI = require('jwplatform');

const jwApi = new JWPlatformAPI({ apiKey: 'INSERT API KEY', apiSecret: 'INSERT API SECRET'});

jwApi.videos.show({ video_key: 'INSERT VIDEO KEY' }).then((response) => { 
    // handle response data 
});

Upload

The JWPlatform library contains a single method for using the single upload method.

const JWPlatformAPI = require('jwplatform');

const jwApi = new JWPlatformAPI({ apiKey: 'INSERT API KEY', apiSecret: 'INSERT API SECRET'});

jwApi.upload({ videoOptions }, '/path/to/file')

Demo

To run a demo of this client, run the following command:

API_KEY='INSERT API KEY' \
API_SECRET='INSERT API SECRET' \
// Different routes will need different ID's. Refer to documentation for required fields.
VIDEO_KEY='INSERT VIDEO ID' \
// i.e. videos/list or videos/conversions/list
DEMO = '{RESOURCE}/{ACTION}'
make demo

Note that only LIST and SHOW actions are available.

Supported Operations

All API methods documentated on the API are available in this client. Please refer here.

Testing

The JW Platform client is tested using chai and mocha. To run the test suite, run the command yarn test.

Coverage reports are available through Istanbul.js, and can be accessed by running yarn coverage.

Linting

This repository is lintned using ESLint and Prettier. Two commands are available for linting:

  • yarn lint: lints projects, without fixing any issues
  • yarn lint --fix: runs and fixes lint issues

License

This code is provided under the Apache 2.0 License.

You can’t perform that action at this time.