Skip to content

Commit db3bd23

Browse files
committed
rebuilt before release
1 parent 5ebe71d commit db3bd23

2 files changed

Lines changed: 98 additions & 12 deletions

File tree

dist/workfront.js

Lines changed: 97 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6818,6 +6818,11 @@ function hasOwnProperty(obj, prop) {
68186818
* limitations under the License.
68196819
*/
68206820

6821+
/**
6822+
* @author Hovhannes Babayan <bhovhannes at gmail dot com>
6823+
* @author Sassoun Derderian <citizen.sas at gmail dot com>
6824+
*/
6825+
68216826
var url = require('url'),
68226827
http = require('http'),
68236828
https = require('https');
@@ -6826,9 +6831,10 @@ var url = require('url'),
68266831
* Creates new Api instance.
68276832
* @param {Object} config An object with the following keys:<br/>
68286833
* <code>url</code> {String} - Required. An url to Workfront server (for example: http://localhost:8080)<br/>
6829-
* <code>version</code> {String} - Optional. Which version of api to use. At the moment of writing can be 1.0, 2.0, 3.0, 4.0. Pass 'unsupported' to use Workfront latest API (maybe unstable).
6834+
* <code>version</code> {String} - Optional. Which version of api to use. At the moment of writing can be 1.0, 2.0, 3.0, 4.0. Pass 'unsupported' to use Workfront latest API (maybe unstable).<br/>
68306835
* <code>secureProtocol</code> {String} - Optional. Used only in https. The SSL method to use, e.g. TLSv1_method to force TLS version 1. The possible values depend on your installation of OpenSSL and are defined in the constant {@link http://www.openssl.org/docs/ssl/ssl.html#DEALING_WITH_PROTOCOL_METHODS|SSL_METHODS}.
68316836
* @constructor
6837+
* @memberOf Workfront
68326838
*/
68336839
function Api(config) {
68346840
var parsed = url.parse(config.url),
@@ -6905,6 +6911,10 @@ module.exports = Api;
69056911
* limitations under the License.
69066912
*/
69076913

6914+
/**
6915+
* @author Hovhannes Babayan <bhovhannes at gmail dot com>
6916+
*/
6917+
69086918
/**
69096919
* @namespace
69106920
* @memberOf Workfront
@@ -7426,6 +7436,11 @@ module.exports = ApiConstants;
74267436
* limitations under the License.
74277437
*/
74287438

7439+
/**
7440+
* @author Hovhannes Babayan <bhovhannes at gmail dot com>
7441+
* @author Sassoun Derderian <citizen.sas at gmail dot com>
7442+
*/
7443+
74297444
var Api = require('./Api'),
74307445
_instance;
74317446

@@ -7485,6 +7500,10 @@ module.exports = {
74857500
* limitations under the License.
74867501
*/
74877502

7503+
/**
7504+
* @author Hovhannes Babayan <bhovhannes at gmail dot com>
7505+
*/
7506+
74887507
/**
74897508
* @name ApiUtil
74907509
* @memberOf Workfront
@@ -7511,10 +7530,14 @@ module.exports = {
75117530
* limitations under the License.
75127531
*/
75137532

7533+
/**
7534+
* @author Hovhannes Babayan <bhovhannes at gmail dot com>
7535+
*/
75147536
module.exports = function(Api) {
75157537
/**
75167538
* Copies an existing object with making changes on a copy.
75177539
* Copying is supported only for some objects. The {@link https://developers.attask.com/api-docs/api-explorer/|Workfront API Explorer} page displays which objects support the Copy action.
7540+
* @memberOf Workfront.Api
75187541
* @param {String} objCode One of object codes from {@link https://developers.attask.com/api-docs/api-explorer/|Workfront API Explorer}
75197542
* @param {String} objID ID of object to copy
75207543
* @param {Object} updates Which fields to set on copied object. See {@link https://developers.attask.com/api-docs/api-explorer/|Workfront API Explorer} for the list of available fields for the given objCode.
@@ -7548,9 +7571,13 @@ module.exports = function(Api) {
75487571
* limitations under the License.
75497572
*/
75507573

7574+
/**
7575+
* @author Hovhannes Babayan <bhovhannes at gmail dot com>
7576+
*/
75517577
module.exports = function(Api) {
75527578
/**
75537579
* Used to retrieve number of objects matching given search criteria
7580+
* @memberOf Workfront.Api
75547581
* @param {String} objCode
75557582
* @param {Object} query An object with search criteria
75567583
* @return {Promise}
@@ -7582,9 +7609,14 @@ module.exports = function(Api) {
75827609
* limitations under the License.
75837610
*/
75847611

7612+
/**
7613+
* @author Hovhannes Babayan <bhovhannes at gmail dot com>
7614+
* @author Sassoun Derderian <citizen.sas at gmail dot com>
7615+
*/
75857616
module.exports = function(Api) {
75867617
/**
75877618
* Creates a new object.
7619+
* @memberOf Workfront.Api
75887620
* @param {String} objCode One of object codes from {@link https://developers.attask.com/api-docs/api-explorer/|Workfront API Explorer}
75897621
* @param {Object} params Values of fields to be set for the new object. See {@link https://developers.attask.com/api-docs/api-explorer/|Workfront API Explorer} for the list of available fields for the given objCode.
75907622
* @param {String[]} [fields] Which fields of newly created object to return. See {@link https://developers.attask.com/api-docs/api-explorer/|Workfront API Explorer} for the list of available fields for the given objCode.
@@ -7611,9 +7643,13 @@ module.exports = function(Api) {
76117643
* limitations under the License.
76127644
*/
76137645

7646+
/**
7647+
* @author Hovhannes Babayan <bhovhannes at gmail dot com>
7648+
*/
76147649
module.exports = function(Api) {
76157650
/**
76167651
* Edits an existing object
7652+
* @memberOf Workfront.Api
76177653
* @param {String} objCode One of object codes from {@link https://developers.attask.com/api-docs/api-explorer/|Workfront API Explorer}
76187654
* @param {String} objID ID of object to modify
76197655
* @param {Object} updates Which fields to set. See {@link https://developers.attask.com/api-docs/api-explorer/|Workfront API Explorer} for the list of available fields for the given objCode.
@@ -7644,18 +7680,29 @@ module.exports = function(Api) {
76447680
* limitations under the License.
76457681
*/
76467682

7683+
/**
7684+
* @author Hovhannes Babayan <bhovhannes at gmail dot com>
7685+
*/
76477686
module.exports = function(Api) {
76487687

76497688
/**
76507689
* Executes an action for the given object
7690+
* @memberOf Workfront.Api
76517691
* @param {String} objCode One of object codes from {@link https://developers.attask.com/api-docs/api-explorer/|Workfront API Explorer}
7652-
* @param {String} objID ID of object
7653-
* @param {String} action An action to execute. A list of allowed named queries are available within the {@link https://developers.attask.com/api-docs/api-explorer/|Workfront API Explorer} under "actions" for each object.
7692+
* @param {String} objID ID of object. Optional, pass null or undefined to omit
7693+
* @param {String} action An action to execute. A list of allowed actions are available within the {@link https://developers.attask.com/api-docs/api-explorer/|Workfront API Explorer} under "actions" for each object.
76547694
* @param {Object} [actionArgs] Optional. Arguments for the action. See {@link https://developers.attask.com/api-docs/api-explorer/|Workfront API Explorer} for the list of valid arguments
76557695
* @returns {Promise} A promise which will resolved if everything went ok and rejected otherwise
76567696
*/
76577697
Api.prototype.execute = function (objCode, objID, action, actionArgs) {
7658-
return this.request(objCode + '/' + objID + '/' + action, actionArgs, null, Api.Methods.PUT);
7698+
var endPoint = objCode;
7699+
if (objID) {
7700+
endPoint += '/' + objID + '/' + action;
7701+
}
7702+
else {
7703+
actionArgs['action'] = action;
7704+
}
7705+
return this.request(endPoint, actionArgs, null, Api.Methods.PUT);
76597706
};
76607707
};
76617708
},{}],45:[function(require,module,exports){
@@ -7675,9 +7722,14 @@ module.exports = function(Api) {
76757722
* limitations under the License.
76767723
*/
76777724

7725+
/**
7726+
* @author Hovhannes Babayan <bhovhannes at gmail dot com>
7727+
* @author Sassoun Derderian <citizen.sas at gmail dot com>
7728+
*/
76787729
module.exports = function(Api) {
76797730
/**
76807731
* Used for retrieve an object or multiple objects.
7732+
* @memberOf Workfront.Api
76817733
* @param {String} objCode One of object codes from {@link https://developers.attask.com/api-docs/api-explorer/|Workfront API Explorer}
76827734
* @param {String|Array} objIDs Either one or multiple object ids
76837735
* @param {Object} fields Which fields to return. See {@link https://developers.attask.com/api-docs/api-explorer/|Workfront API Explorer} for the list of available fields for the given objCode.
@@ -7711,10 +7763,15 @@ module.exports = function(Api) {
77117763
* limitations under the License.
77127764
*/
77137765

7766+
/**
7767+
* @author Hovhannes Babayan <bhovhannes at gmail dot com>
7768+
* @author Sassoun Derderian <citizen.sas at gmail dot com>
7769+
*/
77147770
module.exports = function(Api) {
77157771
/**
77167772
* Logs in into Workfront. Should be a first call to Workfront API.
77177773
* Other calls should be made after this one will be completed.
7774+
* @memberOf Workfront.Api
77187775
* @param {String} username A username in Workfront
77197776
* @param {String} password Password to use
77207777
* @return {Promise} A promise which will resolved with logged in user data if everything went ok and rejected otherwise
@@ -7747,9 +7804,14 @@ module.exports = function(Api) {
77477804
* limitations under the License.
77487805
*/
77497806

7807+
/**
7808+
* @author Hovhannes Babayan <bhovhannes at gmail dot com>
7809+
* @author Sassoun Derderian <citizen.sas at gmail dot com>
7810+
*/
77507811
module.exports = function(Api) {
77517812
/**
77527813
* Logs out from Workfront
7814+
* @memberOf Workfront.Api
77537815
* @return {Promise} A promise which will resolved if everything went ok and rejected otherwise
77547816
*/
77557817
Api.prototype.logout = function () {
@@ -7783,9 +7845,13 @@ module.exports = function(Api) {
77837845
* limitations under the License.
77847846
*/
77857847

7848+
/**
7849+
* @author Hovhannes Babayan <bhovhannes at gmail dot com>
7850+
*/
77867851
module.exports = function(Api) {
77877852
/**
77887853
* Retrieves API metadata for an object.
7854+
* @memberOf Workfront.Api
77897855
* @param {String} [objCode] One of object codes from {@link https://developers.attask.com/api-docs/api-explorer/|Workfront API Explorer}. If omitted will return list of objects available in API.
77907856
* @return {Promise} A promise which will resolved with object metadata if everything went ok and rejected otherwise
77917857
*/
@@ -7814,10 +7880,14 @@ module.exports = function(Api) {
78147880
* limitations under the License.
78157881
*/
78167882

7883+
/**
7884+
* @author Hovhannes Babayan <bhovhannes at gmail dot com>
7885+
*/
78177886
module.exports = function(Api) {
78187887

78197888
/**
78207889
* Executes a named query for the given obj code
7890+
* @memberOf Workfront.Api
78217891
* @param {String} objCode One of object codes from {@link https://developers.attask.com/api-docs/api-explorer/|Workfront API Explorer}
78227892
* @param {String} query A query to execute. A list of allowed named queries are available within the {@link https://developers.attask.com/api-docs/api-explorer/|Workfront API Explorer} under "actions" for each object.
78237893
* @param {Object} [queryArgs] Optional. Arguments for the action. See {@link https://developers.attask.com/api-docs/api-explorer/|Workfront API Explorer} for the list of valid arguments
@@ -7845,10 +7915,14 @@ module.exports = function(Api) {
78457915
* limitations under the License.
78467916
*/
78477917

7918+
/**
7919+
* @author Hovhannes Babayan <bhovhannes at gmail dot com>
7920+
*/
78487921
module.exports = function(Api) {
78497922

78507923
/**
78517924
* Deletes an object
7925+
* @memberOf Workfront.Api
78527926
* @param {String} objCode One of object codes from {@link https://developers.attask.com/api-docs/api-explorer/|Workfront API Explorer}
78537927
* @param {String} objID ID of object
78547928
* @param {Boolean} [bForce] Pass true to cause the server to remove the specified data and its dependants
@@ -7885,9 +7959,13 @@ module.exports = function(Api) {
78857959
* limitations under the License.
78867960
*/
78877961

7962+
/**
7963+
* @author Hovhannes Babayan <bhovhannes at gmail dot com>
7964+
*/
78887965
module.exports = function(Api) {
78897966
/**
78907967
* Performs report request, where only the aggregate of some field is desired, with one or more groupings.
7968+
* @memberOf Workfront.Api
78917969
* @param {String} objCode One of object codes from {@link https://developers.attask.com/api-docs/api-explorer/|Workfront API Explorer}
78927970
* @param {Object} query An object with search criteria and aggregate functions
78937971
* @return {Promise} A promise which will resolved with results if everything went ok and rejected otherwise
@@ -7913,6 +7991,11 @@ module.exports = function(Api) {
79137991
* limitations under the License.
79147992
*/
79157993

7994+
/**
7995+
* @author Hovhannes Babayan <bhovhannes at gmail dot com>
7996+
* @author Sassoun Derderian <citizen.sas at gmail dot com>
7997+
*/
7998+
79167999
var queryString = require('querystring'),
79178000
util = require('util');
79188001

@@ -7953,12 +8036,6 @@ module.exports = function(Api) {
79538036
var httpTransport = this.httpTransport;
79548037

79558038
return new Promise(function (resolve, reject) {
7956-
/*options = {
7957-
url: 'http://echo.jsontest.com',
7958-
path: '/data/123',
7959-
withCredentials: false
7960-
};*/
7961-
79628039
var request = httpTransport.request(options, function (response) {
79638040
var body = '';
79648041
if (typeof response.setEncoding === 'function') {
@@ -8010,9 +8087,14 @@ module.exports = function(Api) {
80108087
* limitations under the License.
80118088
*/
80128089

8090+
/**
8091+
* @author Hovhannes Babayan <bhovhannes at gmail dot com>
8092+
* @author Sassoun Derderian <citizen.sas at gmail dot com>
8093+
*/
80138094
module.exports = function(Api) {
80148095
/**
80158096
* Used for object retrieval by multiple search criteria.
8097+
* @memberOf Workfront.Api
80168098
* @param {String} objCode One of object codes from {@link https://developers.attask.com/api-docs/api-explorer/|Workfront API Explorer}
80178099
* @param {Object} query An object with search criteria
80188100
* @param {Array} [fields] Which fields to return. See {@link https://developers.attask.com/api-docs/api-explorer/|Workfront API Explorer} for the list of available fields for the given objCode.
@@ -8039,14 +8121,18 @@ module.exports = function(Api) {
80398121
* limitations under the License.
80408122
*/
80418123

8124+
/**
8125+
* @author Hovhannes Babayan <bhovhannes at gmail dot com>
8126+
*/
80428127
module.exports = function(Api) {
80438128
/**
80448129
* Starting from version 2.0 API allows users to upload files.
80458130
* The server will return the JSON data which includes 'handle' of uploaded file.
80468131
* Returned 'handle' can be passed to create() method to create a new document.
8132+
* @memberOf Workfront.Api
80478133
* @param {fs.ReadStream} stream A readable stream with file contents
80488134
*/
8049-
Api.prototype.upload = function (stream) {
8135+
Api.prototype.upload = function (/*stream*/) {
80508136
throw new Error('Not implemented')
80518137
};
80528138
};

0 commit comments

Comments
 (0)