leankit-client
Advanced tools
Comparing version 0.6.0 to 1.0.0-beta
@@ -17,3 +17,4 @@ { | ||
], | ||
"version": "0.6.0", | ||
"license": "SEE LICENSE IN https://github.com/LeanKit/leankit-node-client/blob/master/LICENSE", | ||
"version": "1.0.0-beta", | ||
"homepage": "https://github.com/LeanKit/leankit-node-client/", | ||
@@ -35,14 +36,23 @@ "bugs": { | ||
}, | ||
"main": "./leankit-client.js", | ||
"main": "./client.js", | ||
"dependencies": { | ||
"babel": "~5.0", | ||
"change-case": "^2.3.0", | ||
"lodash": "~2.4.0", | ||
"request-json": "~0.5.2", | ||
"lodash": "2.4.*" | ||
"when": "~3.7.4" | ||
}, | ||
"devDependencies": { | ||
"mocha": "*", | ||
"nock": "^0.48.2", | ||
"should": "*" | ||
"chai": "^3.4.1", | ||
"chai-as-promised": "^5.1.0", | ||
"fs-jetpack": "^0.7.0", | ||
"mocha": "^2.3.3", | ||
"nock": "^3.1.0", | ||
"sinon": "^1.17.2" | ||
}, | ||
"scripts": { | ||
"test": "mocha --reporter spec" | ||
"test": "./node_modules/mocha/bin/mocha --compilers js:babel/register --reporter spec", | ||
"test-events": "./node_modules/mocha/bin/mocha ./test/event-tests.js --compilers js:babel/register --reporter spec", | ||
"test-client": "./node_modules/mocha/bin/mocha ./test/client-tests.js --compilers js:babel/register --reporter spec", | ||
"compile": "babel ./src --out-dir ./" | ||
}, | ||
@@ -49,0 +59,0 @@ "repository": { |
166
README.md
## LeanKit Node Client | ||
The LeanKit client module for Node.js provides an easy-to-use set of functions designed to simplify the integration of external systems and utilities with your LeanKit account. | ||
The LeanKit client module for Node.js provides an easy-to-use set of functions designed to simplify the integration of external systems and utilities with your LeanKit account. The client supports both callbacks and promises. There is also a `LeanKitEvents` module for subscribing to board events. | ||
@@ -12,15 +12,118 @@ ### Requirements | ||
npm install leankit-client | ||
``` | ||
npm install leankit-client | ||
``` | ||
### Client usage | ||
### Client usage (callbacks) | ||
var LeanKitClient = require('leankit-client'); | ||
var client = LeanKitClient.createClient('account-name', 'your@email.com', 'your-p@ssw0rd'); | ||
``` | ||
var LeanKitClient = require( "leankit-client" ); | ||
var client = new LeanKitClient( "account-name", "your@email.com", "your-p@ssw0rd" ); | ||
client.getBoards(function(err, res){ | ||
console.log(res); | ||
}); | ||
client.getBoards( function( err, boards ) { | ||
console.log( boards ); | ||
} ); | ||
``` | ||
Review the [tests](https://github.com/LeanKit/leankit-node-client/blob/master/test/client-tests.js) for a full list of client functions and how to use them. | ||
### Client usage (promises) | ||
``` | ||
var LeanKitClient = require( "leankit-client" ); | ||
var client = new LeanKitClient( "account-name", "your@email.com", "your-p@ssw0rd" ); | ||
client.getBoards().then( function( boards ) { | ||
console.log( boards ); | ||
}, function( err ) { | ||
console.log( "ERR:", err ); | ||
} ); | ||
``` | ||
Review the [tests](https://github.com/LeanKit/leankit-node-client/tree/master/test) for a full list of client functions and how to use them. | ||
### Subscribe to events | ||
The LeanKit Client includes a module for monitoring a board for events, such as when cards are created, moved, assigned, and so forth. | ||
**Events usage** | ||
``` | ||
var LeanKitEvents = require( "leankit-client/events" ); | ||
var events = new LeanKitEvents( client, boardId [, version] [, pollInterval] ); | ||
events.on( "event-name", function( e ) { | ||
// Do something with the event | ||
} ); | ||
events.start(); | ||
``` | ||
**Constructor options** | ||
|Parameter|Description| | ||
|:---|:---| | ||
|`client`|An instance of the `LeanKitClient`.| | ||
|`boardId`|The ID of the LeanKit Board to subscribe to.| | ||
|`version`|Optional Board version number. If events have occurred since the given `version`, those will be returned immediately.| | ||
|`pollInterval`|Optional polling interval in seconds. The default is 30 seconds.| | ||
**Sample** | ||
``` | ||
var LeanKitClient = require( "leankit-client" ); | ||
var LeanKitEvents = require( "leankit-client/events" ); | ||
var client = new LeanKitClient( "account-name", "your@email.com", "your-p@ssw0rd" ); | ||
var boardId = 445566789; // The board ID to subscribe to | ||
var events = new LeanKitEvents( client, boardId ); | ||
events.on( "card-creation", function( e ) { | ||
console.log( e ); | ||
} ); | ||
events.start(); | ||
``` | ||
**Sample output when a card is added to the subscribed board:** | ||
``` | ||
{ cardId: 123456789, | ||
eventType: 'card-creation', | ||
eventDateTime: '11/06/2015 03:38:05 PM', | ||
message: 'David Neal created the Card [Sample Card 1] within Lane [ToDo].', | ||
toLaneId: 456789123, | ||
fromLaneId: null, | ||
requiresBoardRefresh: false, | ||
isBlocked: false, | ||
blockedComment: null, | ||
userId: 62984826, | ||
assignedUserId: 0, | ||
isUnassigning: false, | ||
commentText: null, | ||
wipOverrideComment: null, | ||
wipOverrideLane: 0, | ||
wipOverrideUser: 0, | ||
taskboardParentCardId: 0, | ||
taskboardId: 0, | ||
boardVersion: 2 } | ||
``` | ||
**Card events** | ||
|Event|Description| | ||
|:---|:---| | ||
|`card-creation`|Occurs when a new card is added to a board.| | ||
|`card-move`|Occurs when a card is moved on the board.| | ||
|`card-fields-changed`|Occurs when a card's fields are modified (e.g. Title, Description, and so forth)| | ||
|`comment-post`|Occurs when a user posts a comment on a card.| | ||
|`user-assignment`|Occurs when users are assigned or unassigned from a card. Check the `isUnassigning` property to know whether the user is being assigned or unassigned.| | ||
|`attachment-change`|Occurs when an attachment is added to a card.| | ||
|`card-blocked`|Occurs when a card is blocked or unblocked. Check the `isBlocked` property to know whether the card was blocked or unblocked.| | ||
|`card-move-from-board`|Occurs when a card is moved from the board being monitored to another board.| | ||
|`card-move-to-board`|Occurs when a card is moved from another board to the board being monitored.| | ||
|`card-deleted`|Occurs when a card is deleted.| | ||
**Board events** | ||
|Event|Description| | ||
|:---|:---| | ||
|`board-edit`|Occurs when the board layout/structure is modified.| | ||
|`activity-types-changed` |Occurs when custom icons are modified.| | ||
|`board-card-types-changed`|Occurs when card types for the board are modified.| | ||
### Proxy support | ||
@@ -30,13 +133,18 @@ | ||
var LeanKitClient = require('leankit-client'); | ||
var client = LeanKitClient.createClient('account-name', 'your@email.com', 'your-p@ssw0rd', { 'proxy': 'http://localproxy.com' } ); | ||
``` | ||
var LeanKitClient = require("leankit-client"); | ||
var client = LeanKitClient.createClient("account-name", "your@email.com", "your-p@ssw0rd", { "proxy": "http://localproxy.com" } ); | ||
``` | ||
This options object is the same object used by the [request module](https://github.com/mikeal/request#requestoptions-callback). | ||
This `options` object is the same object used by the [request module](https://github.com/mikeal/request#requestoptions-callback). | ||
### Installing Manually | ||
### Installing manually | ||
* Install [babel](https://babeljs.io/docs/setup/#node) | ||
* Clone or download the `leankit-node-client` Github repository. | ||
* Open a Terminal window, change to the repository folder, and install dependent packages. | ||
npm install | ||
``` | ||
npm install | ||
``` | ||
@@ -46,3 +154,3 @@ * Create a folder in your node application's `node_modules` folder named `leankit-client` (e.g. `[project-name]/node_modules/leankit-client). | ||
### Running Tests | ||
### Running tests | ||
@@ -53,13 +161,17 @@ * Set environment variables for the LeanKit account you wish to test with. | ||
export LEANKIT_ACCOUNT=your-account-name | ||
export LEANKIT_EMAIL=your@email.com | ||
export LEANKIT_PASSWORD=your-p@ssw0rd | ||
export LEANKIT_TEST_BOARD=name-of-your-test-board | ||
``` | ||
export LEANKIT_ACCOUNT=your-account-name | ||
export LEANKIT_EMAIL=your@email.com | ||
export LEANKIT_PASSWORD=your-p@ssw0rd | ||
export LEANKIT_TEST_BOARD=name-of-your-test-board | ||
``` | ||
**Windows** | ||
setx LEANKIT_ACCOUNT "your-account-name" | ||
setx LEANKIT_EMAIL "your@email.com" | ||
setx LEANKIT_PASSWORD "your-p@ssw0rd" | ||
setx LEANKIT_TEST_BOARD "name-of-your-test-board" | ||
``` | ||
setx LEANKIT_ACCOUNT "your-account-name" | ||
setx LEANKIT_EMAIL "your@email.com" | ||
setx LEANKIT_PASSWORD "your-p@ssw0rd" | ||
setx LEANKIT_TEST_BOARD "name-of-your-test-board" | ||
``` | ||
@@ -70,3 +182,5 @@ Note: On Windows, you will need to reopen your command prompt after setting environment variables. | ||
npm install -g mocha | ||
``` | ||
npm install -g mocha | ||
``` | ||
@@ -76,3 +190,5 @@ * Open Terminal and change to the LeanKit Node Client directory | ||
npm test | ||
``` | ||
npm test | ||
``` | ||
@@ -79,0 +195,0 @@ ### Questions? |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
105507
24
3007
196
5
6
+ Addedbabel@~5.0
+ Addedchange-case@^2.3.0
+ Addedwhen@~3.7.4
+ Addedacorn@5.7.4(transitive)
+ Addedalign-text@0.1.4(transitive)
+ Addedalter@0.2.0(transitive)
+ Addedamdefine@1.0.1(transitive)
+ Addedanymatch@1.3.2(transitive)
+ Addedarr-diff@2.0.04.0.0(transitive)
+ Addedarr-flatten@1.1.0(transitive)
+ Addedarr-union@3.1.0(transitive)
+ Addedarray-unique@0.2.10.3.2(transitive)
+ Addedassign-symbols@1.0.0(transitive)
+ Addedast-traverse@0.1.1(transitive)
+ Addedast-types@0.8.120.9.6(transitive)
+ Addedasync-each@1.0.6(transitive)
+ Addedatob@2.1.2(transitive)
+ Addedbabel@5.0.13(transitive)
+ Addedbabel-core@5.8.38(transitive)
+ Addedbabel-plugin-constant-folding@1.0.1(transitive)
+ Addedbabel-plugin-dead-code-elimination@1.0.2(transitive)
+ Addedbabel-plugin-eval@1.0.1(transitive)
+ Addedbabel-plugin-inline-environment-variables@1.0.1(transitive)
+ Addedbabel-plugin-jscript@1.0.4(transitive)
+ Addedbabel-plugin-member-expression-literals@1.0.1(transitive)
+ Addedbabel-plugin-property-literals@1.0.1(transitive)
+ Addedbabel-plugin-proto-to-assign@1.0.4(transitive)
+ Addedbabel-plugin-react-constant-elements@1.0.3(transitive)
+ Addedbabel-plugin-react-display-name@1.0.3(transitive)
+ Addedbabel-plugin-remove-console@1.0.1(transitive)
+ Addedbabel-plugin-remove-debugger@1.0.1(transitive)
+ Addedbabel-plugin-runtime@1.0.7(transitive)
+ Addedbabel-plugin-undeclared-variables-check@1.0.2(transitive)
+ Addedbabel-plugin-undefined-to-void@1.1.6(transitive)
+ Addedbabylon@5.8.38(transitive)
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbase@0.11.2(transitive)
+ Addedbinary-extensions@1.13.1(transitive)
+ Addedbindings@1.5.0(transitive)
+ Addedbluebird@2.11.0(transitive)
+ Addedbrace-expansion@1.1.11(transitive)
+ Addedbraces@1.8.52.3.2(transitive)
+ Addedbreakable@1.0.0(transitive)
+ Addedcache-base@1.0.1(transitive)
+ Addedcamel-case@1.2.2(transitive)
+ Addedcamelcase@1.2.1(transitive)
+ Addedcenter-align@0.1.3(transitive)
+ Addedchange-case@2.3.1(transitive)
+ Addedchokidar@1.7.0(transitive)
+ Addedclass-utils@0.3.6(transitive)
+ Addedcliui@2.1.0(transitive)
+ Addedcollection-visit@1.0.0(transitive)
+ Addedcommoner@0.10.8(transitive)
+ Addedcomponent-emitter@1.3.1(transitive)
+ Addedconcat-map@0.0.1(transitive)
+ Addedconstant-case@1.1.2(transitive)
+ Addedconvert-source-map@0.5.11.9.0(transitive)
+ Addedcopy-descriptor@0.1.1(transitive)
+ Addedcore-js@1.2.7(transitive)
+ Addeddebug@2.6.9(transitive)
+ Addeddecamelize@1.2.0(transitive)
+ Addeddecode-uri-component@0.2.2(transitive)
+ Addeddefine-property@0.2.51.0.02.0.2(transitive)
+ Addeddefined@1.0.1(transitive)
+ Addeddefs@1.1.1(transitive)
+ Addeddetect-indent@3.0.1(transitive)
+ Addeddetective@4.7.1(transitive)
+ Addeddot-case@1.1.2(transitive)
+ Addedesprima@2.7.33.1.3(transitive)
+ Addedesprima-fb@15001.1001.0-dev-harmony-fb(transitive)
+ Addedesutils@2.0.3(transitive)
+ Addedexpand-brackets@0.1.52.1.4(transitive)
+ Addedexpand-range@1.8.2(transitive)
+ Addedextend-shallow@2.0.13.0.2(transitive)
+ Addedextglob@0.3.22.0.4(transitive)
+ Addedfile-uri-to-path@1.0.0(transitive)
+ Addedfilename-regex@2.0.1(transitive)
+ Addedfill-range@2.2.44.0.0(transitive)
+ Addedfor-in@1.0.2(transitive)
+ Addedfor-own@0.1.5(transitive)
+ Addedfragment-cache@0.2.1(transitive)
+ Addedfs-readdir-recursive@0.1.2(transitive)
+ Addedfsevents@1.2.13(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedget-stdin@4.0.1(transitive)
+ Addedget-value@2.0.6(transitive)
+ Addedglob@5.0.15(transitive)
+ Addedglob-base@0.3.0(transitive)
+ Addedglob-parent@2.0.0(transitive)
+ Addedglobals@6.4.1(transitive)
+ Addedgraceful-fs@4.2.11(transitive)
+ Addedhas-value@0.3.11.0.0(transitive)
+ Addedhas-values@0.1.41.0.0(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedhome-or-tmp@1.0.0(transitive)
+ Addediconv-lite@0.4.24(transitive)
+ Addedinflight@1.0.6(transitive)
+ Addedinvert-kv@1.0.0(transitive)
+ Addedis-accessor-descriptor@1.0.1(transitive)
+ Addedis-binary-path@1.0.1(transitive)
+ Addedis-buffer@1.1.6(transitive)
+ Addedis-core-module@2.13.1(transitive)
+ Addedis-data-descriptor@1.0.1(transitive)
+ Addedis-descriptor@0.1.71.0.3(transitive)
+ Addedis-dotfile@1.0.3(transitive)
+ Addedis-equal-shallow@0.1.3(transitive)
+ Addedis-extendable@0.1.11.0.1(transitive)
+ Addedis-extglob@1.0.0(transitive)
+ Addedis-finite@1.1.0(transitive)
+ Addedis-glob@2.0.1(transitive)
+ Addedis-integer@1.0.7(transitive)
+ Addedis-lower-case@1.1.3(transitive)
+ Addedis-number@2.1.03.0.04.0.0(transitive)
+ Addedis-plain-object@2.0.4(transitive)
+ Addedis-posix-bracket@0.1.1(transitive)
+ Addedis-primitive@2.0.0(transitive)
+ Addedis-upper-case@1.1.2(transitive)
+ Addedis-windows@1.0.2(transitive)
+ Addedisobject@2.1.03.0.1(transitive)
+ Addedjs-tokens@1.0.1(transitive)
+ Addedjsesc@0.5.0(transitive)
+ Addedjson5@0.4.0(transitive)
+ Addedkind-of@3.2.24.0.06.0.3(transitive)
+ Addedlazy-cache@1.0.4(transitive)
+ Addedlcid@1.0.0(transitive)
+ Addedleven@1.0.2(transitive)
+ Addedlodash@3.10.1(transitive)
+ Addedlongest@1.0.1(transitive)
+ Addedlower-case@1.1.4(transitive)
+ Addedlower-case-first@1.0.2(transitive)
+ Addedmap-cache@0.2.2(transitive)
+ Addedmap-visit@1.0.0(transitive)
+ Addedmath-random@1.0.4(transitive)
+ Addedmicromatch@2.3.113.1.10(transitive)
+ Addedminimatch@2.0.10(transitive)
+ Addedminimist@1.2.8(transitive)
+ Addedmixin-deep@1.3.2(transitive)
+ Addedmkdirp@0.5.6(transitive)
+ Addedms@2.0.0(transitive)
+ Addednan@2.19.0(transitive)
+ Addednanomatch@1.2.13(transitive)
+ Addednormalize-path@2.1.1(transitive)
+ Addedobject-assign@4.1.1(transitive)
+ Addedobject-copy@0.1.0(transitive)
+ Addedobject-visit@1.0.1(transitive)
+ Addedobject.omit@2.0.1(transitive)
+ Addedobject.pick@1.3.0(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedos-locale@1.4.0(transitive)
+ Addedos-tmpdir@1.0.2(transitive)
+ Addedoutput-file-sync@1.1.2(transitive)
+ Addedparam-case@1.1.2(transitive)
+ Addedparse-glob@3.0.4(transitive)
+ Addedpascal-case@1.1.2(transitive)
+ Addedpascalcase@0.1.1(transitive)
+ Addedpath-case@1.1.2(transitive)
+ Addedpath-exists@1.0.0(transitive)
+ Addedpath-is-absolute@1.0.1(transitive)
+ Addedpath-parse@1.0.7(transitive)
+ Addedposix-character-classes@0.1.1(transitive)
+ Addedpreserve@0.2.0(transitive)
+ Addedprivate@0.1.8(transitive)
+ Addedprocess-nextick-args@2.0.1(transitive)
+ Addedq@1.5.1(transitive)
+ Addedrandomatic@3.1.1(transitive)
+ Addedreadable-stream@2.3.8(transitive)
+ Addedreaddirp@2.2.1(transitive)
+ Addedrecast@0.10.330.11.23(transitive)
+ Addedregenerate@1.4.2(transitive)
+ Addedregenerator@0.8.40(transitive)
+ Addedregex-cache@0.4.4(transitive)
+ Addedregex-not@1.0.2(transitive)
+ Addedregexpu@1.3.0(transitive)
+ Addedregjsgen@0.2.0(transitive)
+ Addedregjsparser@0.1.5(transitive)
+ Addedremove-trailing-separator@1.1.0(transitive)
+ Addedrepeat-element@1.1.4(transitive)
+ Addedrepeat-string@1.6.1(transitive)
+ Addedrepeating@1.1.3(transitive)
+ Addedresolve@1.22.8(transitive)
+ Addedresolve-url@0.2.1(transitive)
+ Addedret@0.1.15(transitive)
+ Addedright-align@0.1.3(transitive)
+ Addedsafe-buffer@5.1.2(transitive)
+ Addedsafe-regex@1.1.0(transitive)
+ Addedsentence-case@1.1.3(transitive)
+ Addedset-value@2.0.1(transitive)
+ Addedshebang-regex@1.0.0(transitive)
+ Addedsimple-fmt@0.1.0(transitive)
+ Addedsimple-is@0.2.0(transitive)
+ Addedslash@1.0.0(transitive)
+ Addedsnake-case@1.1.2(transitive)
+ Addedsnapdragon@0.8.2(transitive)
+ Addedsnapdragon-node@2.1.1(transitive)
+ Addedsnapdragon-util@3.0.1(transitive)
+ Addedsource-map@0.1.320.4.40.5.7(transitive)
+ Addedsource-map-resolve@0.5.3(transitive)
+ Addedsource-map-support@0.2.10(transitive)
+ Addedsource-map-url@0.4.1(transitive)
+ Addedsplit-string@3.1.0(transitive)
+ Addedstable@0.1.8(transitive)
+ Addedstatic-extend@0.1.2(transitive)
+ Addedstring_decoder@1.1.1(transitive)
+ Addedstringmap@0.2.2(transitive)
+ Addedstringset@0.2.1(transitive)
+ Addedsupports-preserve-symlinks-flag@1.0.0(transitive)
+ Addedswap-case@1.1.2(transitive)
+ Addedthrough@2.3.8(transitive)
+ Addedtitle-case@1.1.2(transitive)
+ Addedto-fast-properties@1.0.3(transitive)
+ Addedto-object-path@0.3.0(transitive)
+ Addedto-regex@3.0.2(transitive)
+ Addedto-regex-range@2.1.1(transitive)
+ Addedtrim-right@1.0.1(transitive)
+ Addedtry-resolve@1.0.1(transitive)
+ Addedtryor@0.1.2(transitive)
+ Addedunion-value@1.0.1(transitive)
+ Addedunset-value@1.0.0(transitive)
+ Addedupper-case@1.1.3(transitive)
+ Addedupper-case-first@1.1.2(transitive)
+ Addedurix@0.1.0(transitive)
+ Addeduse@3.1.1(transitive)
+ Addeduser-home@1.1.1(transitive)
+ Addedwhen@3.7.8(transitive)
+ Addedwindow-size@0.1.4(transitive)
+ Addedwordwrap@0.0.2(transitive)
+ Addedwrappy@1.0.2(transitive)
+ Addedy18n@3.2.2(transitive)
+ Addedyargs@3.27.0(transitive)
Updatedlodash@~2.4.0