IBM-Cloud / gp-js-client

JavaScript/Node.js client for Globalization Pipeline
https://developer.ibm.com/open/ibm-bluemix-globalization-pipeline-service/node-js-sdk/
Apache License 2.0
8 stars 24 forks source link

add connect(), deprecate getClient() #155

Closed srl295 closed 5 years ago

srl295 commented 5 years ago

~Deprecate~ Remove the getClient() function that returns a Client object. (Yes, the main API since the beginning of this project!)

Instead, use connect() which returns a promise and actually tries to load the swagger.json. Callers are expected to handle any rejections right away.

Fixes: https://github.com/IBM-Cloud/gp-js-client/issues/101

srl295 commented 5 years ago

@JCEmmons this is to fix the 'unhandled rejection' warnings that you saw when js-client could not connect way back when.

srl295 commented 5 years ago

I had marked this as a v4.0 (semver major), so it's probably OK to have the warning, if not break entirely.

srl295 commented 5 years ago
coveralls commented 5 years ago

Coverage Status

Coverage decreased (-0.1%) to 88.667% when pulling 0cfa070b2b326079c70723c0d6aa3c3b09aa0e90 on connect-promise into 7fecc35b7364da3d5afb64503996b2fc4e190377 on master.

srl295 commented 5 years ago

@jugu yes, it will be 4.x. The breaking change is documented in the NEWS section of the readme: https://github.com/IBM-Cloud/gp-js-client/pull/155/files#diff-04c6e90faac2675aa89e2176d2eec7d8R21