Releases: Workfront/workfront-api
v8.1.1
Upgrade to tslib v2
v7.0.2
Fix CommonJS bundle broken in v7.0.0
WHAT CHANGED
- fix: cjs bundle was broken 0cc423e
- Merge branch 'master' of github.com:Workfront/workfront-api c964c57
- Merge pull request #722 from Workfront/renovate/conventional-changelog-cli-2.0.x a95d9f9
- Update dependency conventional-changelog-cli to v2.0.34 86c5109
- Merge pull request #689 from Workfront/renovate/karma-sauce-launcher-4.x 1062b59
- Update dependency karma-sauce-launcher to v4 6e4b755
- Merge pull request #721 from Workfront/renovate/karma-5.0.x 3fbbc09
- Update dependency karma to v5.0.5 3ed05fa
Drop Node 8 support
Starting from this version Node 8 is no longer officially supported.
WHAT CHANGED
- Package now has
sideEffects: true
in package.json - Rollup and its plugins were been updated to their latest versions
- We switched to Yarn
- ... and a bunch of dependency upgrades
BREAKING CHANGE
- Node 8 is no longer supported
v6.0.0
This version is merely reducing the bundle size for browsers.
WHAT CHANGED
We now use Rollup instead of Webpack for bundling the package. There are now three files in the dist
.
workfront-api.cjs.js
use in NodeJS environment.workfront-api.es.js
use in browser environment. Modules which have workfront-api dependency.workfront-api.umd.js
orworkfront-api.umd.min.js
use in browser environment by requesting the file via the<script>
tag. One loaded into the browser, it creates a global variableWorkfront
.
BREAKING CHANGE
- Entry points have changed. This will affect UMD consumers. Now the file name is
workfront-api.umd.js
andworkfront-api.umd.min.js
respectfully. - For Node users, the api class name has been changed to
NodeApi
. This is to prevent typing ambiguities.
i.e.
const Workfront = require('workfront-api')
const api = new Workfront.NodeApi({/*...*/})
Batching calls
Features
- Added
batch()
method for sending multiple queries in a single network call.
Info
The batch()
method has a single argument - URI collector function. URI collector function should return an array of URIs which should be executed in a single network call by batch()
.
In order to simplify creation of URIs, URI collector function passed to the batch()
method receives a special instance of Api
, implementing IBatchApi
interface. Almost all functions from Api
are available in IBatchApi
, with the same signatures as in Api
but with one difference - all of them return a string.
Usage
// Let's `api` to be an Api instance
api.batch(batchApi => {
// we should return an array of URIs (path + query portion)
return [
// we can directly write `/USER/count`, but we can use a familiar api instead
batchApi.count('USER'),
// URI to get metadata for TASK object
batchApi.metadata('TASK', ['fields']),
// another URI
batchApi.metadata('PROJ', ['collections'])
]
})
Metadata fields
Features
- Added second parameter to
metadata()
method.
Parameter name isfields
and it can be used if you want some of fields from metadata result.
X-XSRF-TOKEN
With this release we implemented XSRF-TOKEN to prevent Cross-Site Request Forgery (CSRF)
Features
- Add new setXSRFToken method which is then used in the request headers.
v4.5.0
New
- A new api method
editMultiple
to edit multiple object in one request.
api.editMultiple('TASK', [
{ID: 'fooID', name: 'foo'},
{ID: 'barID', name: 'bar'},
{ID: 'bazID', name: 'baz'}
]);