comprodls-sdk 2.48.0 → 2.50.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -284,6 +284,7 @@ exports.AUTH_API_URLS = {
284
284
  getSettingsField: '/org/{orgId}/settings/{field}',
285
285
  getClassUsersAPI: '/org/{orgId}/class/{classId}/users',
286
286
  getUserClassesAPI: '/org/{orgId}/users/{userId}/classes',
287
+ getUserClassesV2API: '/org/{orgid}/users/{userid}/class-enrollments',
287
288
  getAllJobs: '/accounts/{accountId}/ext-users/{extUserId}/jobs',
288
289
  getJob: '/accounts/{accountId}/ext-users/{extUserId}/jobs/{jobId}',
289
290
  getAllClassesAPI: '/org/{orgId}/classes',
@@ -799,7 +800,7 @@ function addClassIdQueryParam(url, classId) {
799
800
  function setupAPIToken(request, token) {
800
801
  return request.set('Authorization', token.access_token);
801
802
  };
802
- },{"../../../config":2,"../../../helpers":3,"../errors":7,"./validations":6,"q":58,"string-template":84,"superagent":85}],6:[function(require,module,exports){
803
+ },{"../../../config":2,"../../../helpers":3,"../errors":7,"./validations":6,"q":58,"string-template":87,"superagent":88}],6:[function(require,module,exports){
803
804
  /*************************************************************************
804
805
  *
805
806
  * COMPRO CONFIDENTIAL
@@ -1131,7 +1132,7 @@ validator.validators.contains = function(value, options) {
1131
1132
  }
1132
1133
  }
1133
1134
  };
1134
- },{"./errors":7,"validate.js":90}],10:[function(require,module,exports){
1135
+ },{"./errors":7,"validate.js":92}],10:[function(require,module,exports){
1135
1136
  /*************************************************************************
1136
1137
  *
1137
1138
  * COMPRO CONFIDENTIAL
@@ -1254,7 +1255,7 @@ function getSingleInvitation(organizationId, options) {
1254
1255
  }
1255
1256
 
1256
1257
 
1257
- },{"../helpers":3,"q":58,"superagent":85}],11:[function(require,module,exports){
1258
+ },{"../helpers":3,"q":58,"superagent":88}],11:[function(require,module,exports){
1258
1259
  /*************************************************************************
1259
1260
  *
1260
1261
  * COMPRO CONFIDENTIAL
@@ -1465,7 +1466,7 @@ Activity.prototype.getQuestionsCount = function () {
1465
1466
  return dfd.promise;
1466
1467
  }
1467
1468
 
1468
- },{"../../helpers":3,"./attempt":12,"extend":44,"q":58,"superagent":85}],12:[function(require,module,exports){
1469
+ },{"../../helpers":3,"./attempt":12,"extend":45,"q":58,"superagent":88}],12:[function(require,module,exports){
1469
1470
  /*************************************************************************
1470
1471
  *
1471
1472
  * COMPRO CONFIDENTIAL
@@ -1898,7 +1899,7 @@ Attempt.prototype.submit = function (userresponse) {
1898
1899
  return dfd.promise;
1899
1900
  };
1900
1901
 
1901
- },{"../../helpers":3,"extend":44,"q":58,"superagent":85}],13:[function(require,module,exports){
1902
+ },{"../../helpers":3,"extend":45,"q":58,"superagent":88}],13:[function(require,module,exports){
1902
1903
  /*************************************************************************
1903
1904
  *
1904
1905
  * COMPRO CONFIDENTIAL
@@ -3827,7 +3828,7 @@ function postProgressTimeseries(options) {
3827
3828
  return dfd.promise;
3828
3829
  }
3829
3830
 
3830
- },{"../../helpers":3,"agentkeepalive":36,"q":58,"superagent":85}],15:[function(require,module,exports){
3831
+ },{"../../helpers":3,"agentkeepalive":36,"q":58,"superagent":88}],15:[function(require,module,exports){
3831
3832
  /*************************************************************************
3832
3833
  *
3833
3834
  * COMPRO CONFIDENTIAL
@@ -4267,7 +4268,7 @@ function getUserActivityMeta(options) {
4267
4268
  }
4268
4269
  return dfd.promise;
4269
4270
  }
4270
- },{"../../helpers":3,"q":58,"superagent":85}],16:[function(require,module,exports){
4271
+ },{"../../helpers":3,"q":58,"superagent":88}],16:[function(require,module,exports){
4271
4272
  /*************************************************************************
4272
4273
  *
4273
4274
  * COMPRO CONFIDENTIAL
@@ -4323,6 +4324,7 @@ function auth() {
4323
4324
  deleteUserProfile: deleteUserProfile.bind(this),
4324
4325
  updateUserRole: updateUserRole.bind(this),
4325
4326
  getUserClasses: getUserClasses.bind(this),
4327
+ getUserClassesV2: getUserClassesV2.bind(this),
4326
4328
  getClassUsers: getClassUsers.bind(this),
4327
4329
  enrollUsertoClass: enrollUsertoClass.bind(this),
4328
4330
  enrollSelftoClass: enrollSelftoClass.bind(this),
@@ -4962,6 +4964,78 @@ function getUserClasses(options) {
4962
4964
  return dfd.promise;
4963
4965
  }
4964
4966
 
4967
+ /**
4968
+ * @param {
4969
+ * userid: 'uuid or username', // Mandatory
4970
+ * shadow: true/false, // Optional, filter shadow enrollments
4971
+ * status_active: true/false, // Optional, filter for status_active enrollments
4972
+ * status_ended: true/false, // Optional, filter for status_ended enrollments
4973
+ * status_expired: true/false, // Optional, filter for status_expired enrollments
4974
+ * details: true/false, // Optional, includes products & meta information of classes
4975
+ * bundleDetails: true/false // Optional, includes products, bundles & meta information of classes
4976
+ * limit: integer, // Optional, Number of entities to be fetched
4977
+ * cursor: 'cursor' // Optional, cursor to get next set of enrollments
4978
+ * } options
4979
+ */
4980
+ function getUserClassesV2(options) {
4981
+ var self = this, orgId = self.orgId, token = self.token;
4982
+
4983
+ // Initializing promise
4984
+ var deferred = q.defer();
4985
+
4986
+ // Validations
4987
+ var error = helpers.validations.isAuthenticated(orgId, token);
4988
+
4989
+ if (error) {
4990
+ deferred.reject(error);
4991
+ } else if (options && options.userid) {
4992
+ var userId = options.userid;
4993
+
4994
+ // Passed all validations, Construct API url
4995
+ var url = self.config.DEFAULT_HOSTS.AUTH + self.config.AUTH_API_URLS.getUserClassesV2API;
4996
+ url = helpers.api.constructAPIUrl(url, { orgid: orgId, userid: userId });
4997
+
4998
+ // Contruct query parameters
4999
+ var params = {};
5000
+ if (options) {
5001
+ if (options.shadow ) { params.shadow = options.shadow ; }
5002
+ if (options.status_active ) { params.status_active = options.status_active ; }
5003
+ if (options.status_ended ) { params.status_ended = options.status_ended ; }
5004
+ if (options.status_expired ) { params.status_expired = options.status_expired ; }
5005
+ if (options.details) { params.details = options.details; }
5006
+ if (options.bundleDetails) { params.bundleDetails = options.bundleDetails; }
5007
+ if (options.limit) { params.limit = options.limit; }
5008
+ if (options.cursor) { params.cursor = options.cursor; }
5009
+ }
5010
+
5011
+ // Setup request with URL and Params
5012
+ var requestAPI = request.get(url).query(params);
5013
+ if (self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
5014
+
5015
+ // Setup token in Authorization header
5016
+ requestAPI = helpers.api.setupAPIToken(requestAPI, token);
5017
+
5018
+ // Call GET User Class-Enrollments API
5019
+ requestAPI
5020
+ .agent(keepaliveAgent)
5021
+ .end(function(error, response) {
5022
+ if (error) {
5023
+ error = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, error);
5024
+ deferred.reject(error);
5025
+ } else {
5026
+ deferred.resolve(response.body);
5027
+ }
5028
+ });
5029
+ } else {
5030
+ error = {};
5031
+ error.message = error.description = 'Required parameter \'userid\' is not found in request options.';
5032
+ error = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, error);
5033
+ deferred.reject(error);
5034
+ }
5035
+
5036
+ return deferred.promise;
5037
+ }
5038
+
4965
5039
  /**
4966
5040
  * options = {
4967
5041
  * classid: 'classid',
@@ -8342,7 +8416,7 @@ function getAllCustomComponents(options) {
8342
8416
  return deferred.promise;
8343
8417
  }
8344
8418
 
8345
- },{"../../helpers":3,"../../helpers/lib/api/converter":4,"agentkeepalive":36,"q":58,"superagent":85}],17:[function(require,module,exports){
8419
+ },{"../../helpers":3,"../../helpers/lib/api/converter":4,"agentkeepalive":36,"q":58,"superagent":88}],17:[function(require,module,exports){
8346
8420
  /*************************************************************************
8347
8421
  *
8348
8422
  * COMPRO CONFIDENTIAL
@@ -9053,7 +9127,7 @@ function getClassesOfAGradeformat(options) {
9053
9127
  return deferred.promise;
9054
9128
  }
9055
9129
 
9056
- },{"../../helpers":3,"agentkeepalive":36,"q":58,"superagent":85}],18:[function(require,module,exports){
9130
+ },{"../../helpers":3,"agentkeepalive":36,"q":58,"superagent":88}],18:[function(require,module,exports){
9057
9131
  /*************************************************************************
9058
9132
  *
9059
9133
  * COMPRO CONFIDENTIAL
@@ -9523,7 +9597,7 @@ function updateConnectionForUser(orgid, token, config, options, action) {
9523
9597
  return dfd.promise;
9524
9598
  }
9525
9599
 
9526
- },{"../../helpers":3,"q":58,"superagent":85}],19:[function(require,module,exports){
9600
+ },{"../../helpers":3,"q":58,"superagent":88}],19:[function(require,module,exports){
9527
9601
  /*************************************************************************
9528
9602
  *
9529
9603
  * COMPRO CONFIDENTIAL
@@ -9835,7 +9909,7 @@ function getAllDataSyncManagersOfAGroup(options) {
9835
9909
  return deferred.promise;
9836
9910
  }
9837
9911
 
9838
- },{"../../helpers":3,"agentkeepalive":36,"q":58,"superagent":85}],20:[function(require,module,exports){
9912
+ },{"../../helpers":3,"agentkeepalive":36,"q":58,"superagent":88}],20:[function(require,module,exports){
9839
9913
  /*************************************************************************
9840
9914
  *
9841
9915
  * COMPRO CONFIDENTIAL
@@ -9981,7 +10055,7 @@ function getAllDocumentsInAFolder(options) {
9981
10055
  return dfd.promise;
9982
10056
  }
9983
10057
 
9984
- },{"../../helpers":3,"q":58,"superagent":85}],21:[function(require,module,exports){
10058
+ },{"../../helpers":3,"q":58,"superagent":88}],21:[function(require,module,exports){
9985
10059
  /*************************************************************************
9986
10060
  *
9987
10061
  * COMPRO CONFIDENTIAL
@@ -10538,7 +10612,7 @@ function deleteSchedule(options) {
10538
10612
  return deferred.promise;
10539
10613
  }
10540
10614
 
10541
- },{"../../helpers":3,"../../helpers/lib/api/converter":4,"agentkeepalive":36,"q":58,"superagent":85}],22:[function(require,module,exports){
10615
+ },{"../../helpers":3,"../../helpers/lib/api/converter":4,"agentkeepalive":36,"q":58,"superagent":88}],22:[function(require,module,exports){
10542
10616
  /*************************************************************************
10543
10617
  *
10544
10618
  * COMPRO CONFIDENTIAL
@@ -10863,7 +10937,7 @@ function resendSingleInvitation(options) {
10863
10937
  return dfd.promise;
10864
10938
  }
10865
10939
 
10866
- },{"../../helpers":3,"q":58,"superagent":85}],23:[function(require,module,exports){
10940
+ },{"../../helpers":3,"q":58,"superagent":88}],23:[function(require,module,exports){
10867
10941
  /*************************************************************************
10868
10942
  *
10869
10943
  * COMPRO CONFIDENTIAL
@@ -11324,7 +11398,7 @@ function createStatement(options) {
11324
11398
  }*/
11325
11399
 
11326
11400
 
11327
- },{"../../helpers":3,"q":58,"tincanjs":87}],24:[function(require,module,exports){
11401
+ },{"../../helpers":3,"q":58,"tincanjs":89}],24:[function(require,module,exports){
11328
11402
  /*************************************************************************
11329
11403
  *
11330
11404
  * COMPRO CONFIDENTIAL
@@ -11672,7 +11746,7 @@ function getSingleProductFamily(options) {
11672
11746
  return dfd.promise;
11673
11747
  }
11674
11748
 
11675
- },{"../../helpers":3,"q":58,"superagent":85}],25:[function(require,module,exports){
11749
+ },{"../../helpers":3,"q":58,"superagent":88}],25:[function(require,module,exports){
11676
11750
  /*************************************************************************
11677
11751
  *
11678
11752
  * COMPRO CONFIDENTIAL
@@ -12272,7 +12346,7 @@ function getAllProductFamilies(options) {
12272
12346
  return dfd.promise;
12273
12347
  }
12274
12348
 
12275
- },{"../../helpers":3,"q":58,"superagent":85}],26:[function(require,module,exports){
12349
+ },{"../../helpers":3,"q":58,"superagent":88}],26:[function(require,module,exports){
12276
12350
  /*************************************************************************
12277
12351
  *
12278
12352
  * COMPRO CONFIDENTIAL
@@ -12472,7 +12546,7 @@ function grantByAccountIdOnExtUserId(options) {
12472
12546
  }
12473
12547
 
12474
12548
 
12475
- },{"../../helpers":3,"./pubnubClientWrapper":27,"q":58,"superagent":85}],27:[function(require,module,exports){
12549
+ },{"../../helpers":3,"./pubnubClientWrapper":27,"q":58,"superagent":88}],27:[function(require,module,exports){
12476
12550
  var pubNub = require("pubnub");
12477
12551
  var EventEmitter = require("events").EventEmitter;
12478
12552
  var helpers = require('../../helpers');
@@ -12685,7 +12759,7 @@ module.exports = function () {
12685
12759
 
12686
12760
  }; //End of Client Wrapper module
12687
12761
 
12688
- },{"../../helpers":3,"events":43,"pubnub":56}],28:[function(require,module,exports){
12762
+ },{"../../helpers":3,"events":44,"pubnub":56}],28:[function(require,module,exports){
12689
12763
  /*************************************************************************
12690
12764
  *
12691
12765
  * COMPRO CONFIDENTIAL
@@ -13152,7 +13226,7 @@ function deleteRule(options) {
13152
13226
  return dfd.promise;
13153
13227
  }
13154
13228
 
13155
- },{"../../helpers":3,"q":58,"superagent":85}],29:[function(require,module,exports){
13229
+ },{"../../helpers":3,"q":58,"superagent":88}],29:[function(require,module,exports){
13156
13230
  /*************************************************************************
13157
13231
  *
13158
13232
  * COMPRO CONFIDENTIAL
@@ -14308,7 +14382,7 @@ function updateInstituteTitle(options){
14308
14382
  return dfd.promise;
14309
14383
  }
14310
14384
 
14311
- },{"../../helpers":3,"agentkeepalive":36,"q":58,"superagent":85}],30:[function(require,module,exports){
14385
+ },{"../../helpers":3,"agentkeepalive":36,"q":58,"superagent":88}],30:[function(require,module,exports){
14312
14386
  /*************************************************************************
14313
14387
  *
14314
14388
  * COMPRO CONFIDENTIAL
@@ -14485,7 +14559,7 @@ function provisionSpacesToSuperAdmin(options) {
14485
14559
  return dfd.promise;
14486
14560
  }
14487
14561
 
14488
- },{"../../helpers":3,"q":58,"superagent":85}],31:[function(require,module,exports){
14562
+ },{"../../helpers":3,"q":58,"superagent":88}],31:[function(require,module,exports){
14489
14563
  /*************************************************************************
14490
14564
  *
14491
14565
  * COMPRO CONFIDENTIAL
@@ -14922,7 +14996,7 @@ function getAllTags(options) {
14922
14996
  return dfd.promise;
14923
14997
  }
14924
14998
 
14925
- },{"../../helpers":3,"q":58,"superagent":85}],32:[function(require,module,exports){
14999
+ },{"../../helpers":3,"q":58,"superagent":88}],32:[function(require,module,exports){
14926
15000
  /*************************************************************************
14927
15001
  *
14928
15002
  * COMPRO CONFIDENTIAL
@@ -15388,7 +15462,7 @@ function updateWorkflowRequest(options) {
15388
15462
  }
15389
15463
  return dfd.promise;
15390
15464
  }
15391
- },{"./../../helpers":3,"q":58,"superagent":85}],33:[function(require,module,exports){
15465
+ },{"./../../helpers":3,"q":58,"superagent":88}],33:[function(require,module,exports){
15392
15466
  /*************************************************************************
15393
15467
  *
15394
15468
  * COMPRO CONFIDENTIAL
@@ -15665,7 +15739,7 @@ function resetUserProductProgress(options) {
15665
15739
  return dfd.promise;
15666
15740
  }
15667
15741
 
15668
- },{"../../helpers":3,"q":58,"superagent":85}],34:[function(require,module,exports){
15742
+ },{"../../helpers":3,"q":58,"superagent":88}],34:[function(require,module,exports){
15669
15743
  /*************************************************************************
15670
15744
  *
15671
15745
  * COMPRO CONFIDENTIAL
@@ -15781,7 +15855,7 @@ function authWithToken(organizationId, token, options) {
15781
15855
  return dfd.promise;
15782
15856
  };
15783
15857
 
15784
- },{"../helpers":3,"./validations":35,"q":58,"superagent":85}],35:[function(require,module,exports){
15858
+ },{"../helpers":3,"./validations":35,"q":58,"superagent":88}],35:[function(require,module,exports){
15785
15859
  /*************************************************************************
15786
15860
  *
15787
15861
  * COMPRO CONFIDENTIAL
@@ -15879,8 +15953,6 @@ module.exports.HttpsAgent = noop;
15879
15953
  function noop () {}
15880
15954
 
15881
15955
  },{}],37:[function(require,module,exports){
15882
-
15883
- },{}],38:[function(require,module,exports){
15884
15956
  var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
15885
15957
 
15886
15958
  ;(function (exports) {
@@ -16006,6 +16078,8 @@ var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
16006
16078
  exports.fromByteArray = uint8ToBase64
16007
16079
  }(typeof exports === 'undefined' ? (this.base64js = {}) : exports))
16008
16080
 
16081
+ },{}],38:[function(require,module,exports){
16082
+
16009
16083
  },{}],39:[function(require,module,exports){
16010
16084
  (function (global){
16011
16085
  /*!
@@ -17558,7 +17632,7 @@ function blitBuffer (src, dst, offset, length) {
17558
17632
  }
17559
17633
 
17560
17634
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
17561
- },{"base64-js":38,"ieee754":47,"isarray":40}],40:[function(require,module,exports){
17635
+ },{"base64-js":37,"ieee754":48,"isarray":40}],40:[function(require,module,exports){
17562
17636
  var toString = {}.toString;
17563
17637
 
17564
17638
  module.exports = Array.isArray || function (arr) {
@@ -17627,6 +17701,169 @@ module.exports = {
17627
17701
  }
17628
17702
 
17629
17703
  },{}],42:[function(require,module,exports){
17704
+
17705
+ /**
17706
+ * Expose `Emitter`.
17707
+ */
17708
+
17709
+ module.exports = Emitter;
17710
+
17711
+ /**
17712
+ * Initialize a new `Emitter`.
17713
+ *
17714
+ * @api public
17715
+ */
17716
+
17717
+ function Emitter(obj) {
17718
+ if (obj) return mixin(obj);
17719
+ };
17720
+
17721
+ /**
17722
+ * Mixin the emitter properties.
17723
+ *
17724
+ * @param {Object} obj
17725
+ * @return {Object}
17726
+ * @api private
17727
+ */
17728
+
17729
+ function mixin(obj) {
17730
+ for (var key in Emitter.prototype) {
17731
+ obj[key] = Emitter.prototype[key];
17732
+ }
17733
+ return obj;
17734
+ }
17735
+
17736
+ /**
17737
+ * Listen on the given `event` with `fn`.
17738
+ *
17739
+ * @param {String} event
17740
+ * @param {Function} fn
17741
+ * @return {Emitter}
17742
+ * @api public
17743
+ */
17744
+
17745
+ Emitter.prototype.on =
17746
+ Emitter.prototype.addEventListener = function(event, fn){
17747
+ this._callbacks = this._callbacks || {};
17748
+ (this._callbacks['$' + event] = this._callbacks['$' + event] || [])
17749
+ .push(fn);
17750
+ return this;
17751
+ };
17752
+
17753
+ /**
17754
+ * Adds an `event` listener that will be invoked a single
17755
+ * time then automatically removed.
17756
+ *
17757
+ * @param {String} event
17758
+ * @param {Function} fn
17759
+ * @return {Emitter}
17760
+ * @api public
17761
+ */
17762
+
17763
+ Emitter.prototype.once = function(event, fn){
17764
+ function on() {
17765
+ this.off(event, on);
17766
+ fn.apply(this, arguments);
17767
+ }
17768
+
17769
+ on.fn = fn;
17770
+ this.on(event, on);
17771
+ return this;
17772
+ };
17773
+
17774
+ /**
17775
+ * Remove the given callback for `event` or all
17776
+ * registered callbacks.
17777
+ *
17778
+ * @param {String} event
17779
+ * @param {Function} fn
17780
+ * @return {Emitter}
17781
+ * @api public
17782
+ */
17783
+
17784
+ Emitter.prototype.off =
17785
+ Emitter.prototype.removeListener =
17786
+ Emitter.prototype.removeAllListeners =
17787
+ Emitter.prototype.removeEventListener = function(event, fn){
17788
+ this._callbacks = this._callbacks || {};
17789
+
17790
+ // all
17791
+ if (0 == arguments.length) {
17792
+ this._callbacks = {};
17793
+ return this;
17794
+ }
17795
+
17796
+ // specific event
17797
+ var callbacks = this._callbacks['$' + event];
17798
+ if (!callbacks) return this;
17799
+
17800
+ // remove all handlers
17801
+ if (1 == arguments.length) {
17802
+ delete this._callbacks['$' + event];
17803
+ return this;
17804
+ }
17805
+
17806
+ // remove specific handler
17807
+ var cb;
17808
+ for (var i = 0; i < callbacks.length; i++) {
17809
+ cb = callbacks[i];
17810
+ if (cb === fn || cb.fn === fn) {
17811
+ callbacks.splice(i, 1);
17812
+ break;
17813
+ }
17814
+ }
17815
+ return this;
17816
+ };
17817
+
17818
+ /**
17819
+ * Emit `event` with the given args.
17820
+ *
17821
+ * @param {String} event
17822
+ * @param {Mixed} ...
17823
+ * @return {Emitter}
17824
+ */
17825
+
17826
+ Emitter.prototype.emit = function(event){
17827
+ this._callbacks = this._callbacks || {};
17828
+ var args = [].slice.call(arguments, 1)
17829
+ , callbacks = this._callbacks['$' + event];
17830
+
17831
+ if (callbacks) {
17832
+ callbacks = callbacks.slice(0);
17833
+ for (var i = 0, len = callbacks.length; i < len; ++i) {
17834
+ callbacks[i].apply(this, args);
17835
+ }
17836
+ }
17837
+
17838
+ return this;
17839
+ };
17840
+
17841
+ /**
17842
+ * Return array of callbacks for `event`.
17843
+ *
17844
+ * @param {String} event
17845
+ * @return {Array}
17846
+ * @api public
17847
+ */
17848
+
17849
+ Emitter.prototype.listeners = function(event){
17850
+ this._callbacks = this._callbacks || {};
17851
+ return this._callbacks['$' + event] || [];
17852
+ };
17853
+
17854
+ /**
17855
+ * Check if this emitter has `event` handlers.
17856
+ *
17857
+ * @param {String} event
17858
+ * @return {Boolean}
17859
+ * @api public
17860
+ */
17861
+
17862
+ Emitter.prototype.hasListeners = function(event){
17863
+ return !! this.listeners(event).length;
17864
+ };
17865
+
17866
+ },{}],43:[function(require,module,exports){
17630
17867
  // Copyright Joyent, Inc. and other Node contributors.
17631
17868
  //
17632
17869
  // Permission is hereby granted, free of charge, to any person obtaining a
@@ -17735,7 +17972,7 @@ function objectToString(o) {
17735
17972
  return Object.prototype.toString.call(o);
17736
17973
  }
17737
17974
 
17738
- },{"buffer":39}],43:[function(require,module,exports){
17975
+ },{"buffer":39}],44:[function(require,module,exports){
17739
17976
  // Copyright Joyent, Inc. and other Node contributors.
17740
17977
  //
17741
17978
  // Permission is hereby granted, free of charge, to any person obtaining a
@@ -18038,7 +18275,7 @@ function isUndefined(arg) {
18038
18275
  return arg === void 0;
18039
18276
  }
18040
18277
 
18041
- },{}],44:[function(require,module,exports){
18278
+ },{}],45:[function(require,module,exports){
18042
18279
  var hasOwn = Object.prototype.hasOwnProperty;
18043
18280
  var toStr = Object.prototype.toString;
18044
18281
  var defineProperty = Object.defineProperty;
@@ -18159,7 +18396,7 @@ module.exports = function extend() {
18159
18396
  return target;
18160
18397
  };
18161
18398
 
18162
- },{}],45:[function(require,module,exports){
18399
+ },{}],46:[function(require,module,exports){
18163
18400
 
18164
18401
  var hasOwn = Object.prototype.hasOwnProperty;
18165
18402
  var toString = Object.prototype.toString;
@@ -18183,7 +18420,7 @@ module.exports = function forEach (obj, fn, ctx) {
18183
18420
  };
18184
18421
 
18185
18422
 
18186
- },{}],46:[function(require,module,exports){
18423
+ },{}],47:[function(require,module,exports){
18187
18424
  var http = require('http');
18188
18425
 
18189
18426
  var https = module.exports;
@@ -18199,7 +18436,7 @@ https.request = function (params, cb) {
18199
18436
  return http.request.call(this, params, cb);
18200
18437
  }
18201
18438
 
18202
- },{"http":80}],47:[function(require,module,exports){
18439
+ },{"http":82}],48:[function(require,module,exports){
18203
18440
  /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
18204
18441
  exports.read = function (buffer, offset, isLE, mLen, nBytes) {
18205
18442
  var e, m
@@ -18286,7 +18523,7 @@ exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
18286
18523
  buffer[offset + i - d] |= s * 128
18287
18524
  }
18288
18525
 
18289
- },{}],48:[function(require,module,exports){
18526
+ },{}],49:[function(require,module,exports){
18290
18527
 
18291
18528
  var indexOf = [].indexOf;
18292
18529
 
@@ -18297,35 +18534,6 @@ module.exports = function(arr, obj){
18297
18534
  }
18298
18535
  return -1;
18299
18536
  };
18300
- },{}],49:[function(require,module,exports){
18301
- if (typeof Object.create === 'function') {
18302
- // implementation from standard node.js 'util' module
18303
- module.exports = function inherits(ctor, superCtor) {
18304
- if (superCtor) {
18305
- ctor.super_ = superCtor
18306
- ctor.prototype = Object.create(superCtor.prototype, {
18307
- constructor: {
18308
- value: ctor,
18309
- enumerable: false,
18310
- writable: true,
18311
- configurable: true
18312
- }
18313
- })
18314
- }
18315
- };
18316
- } else {
18317
- // old school shim for old browsers
18318
- module.exports = function inherits(ctor, superCtor) {
18319
- if (superCtor) {
18320
- ctor.super_ = superCtor
18321
- var TempCtor = function () {}
18322
- TempCtor.prototype = superCtor.prototype
18323
- ctor.prototype = new TempCtor()
18324
- ctor.prototype.constructor = ctor
18325
- }
18326
- }
18327
- }
18328
-
18329
18537
  },{}],50:[function(require,module,exports){
18330
18538
  'use strict';
18331
18539
 
@@ -21575,165 +21783,9 @@ exports.decode = exports.parse = require('./decode');
21575
21783
  exports.encode = exports.stringify = require('./encode');
21576
21784
 
21577
21785
  },{"./decode":59,"./encode":60}],62:[function(require,module,exports){
21578
-
21579
- /**
21580
- * Reduce `arr` with `fn`.
21581
- *
21582
- * @param {Array} arr
21583
- * @param {Function} fn
21584
- * @param {Mixed} initial
21585
- *
21586
- * TODO: combatible error handling?
21587
- */
21588
-
21589
- module.exports = function(arr, fn, initial){
21590
- var idx = 0;
21591
- var len = arr.length;
21592
- var curr = arguments.length == 3
21593
- ? initial
21594
- : arr[idx++];
21595
-
21596
- while (idx < len) {
21597
- curr = fn.call(null, curr, arr[idx], ++idx, arr);
21598
- }
21599
-
21600
- return curr;
21601
- };
21602
- },{}],63:[function(require,module,exports){
21603
- // Copyright Joyent, Inc. and other Node contributors.
21604
- //
21605
- // Permission is hereby granted, free of charge, to any person obtaining a
21606
- // copy of this software and associated documentation files (the
21607
- // "Software"), to deal in the Software without restriction, including
21608
- // without limitation the rights to use, copy, modify, merge, publish,
21609
- // distribute, sublicense, and/or sell copies of the Software, and to permit
21610
- // persons to whom the Software is furnished to do so, subject to the
21611
- // following conditions:
21612
- //
21613
- // The above copyright notice and this permission notice shall be included
21614
- // in all copies or substantial portions of the Software.
21615
- //
21616
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21617
- // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21618
- // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
21619
- // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
21620
- // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
21621
- // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
21622
- // USE OR OTHER DEALINGS IN THE SOFTWARE.
21623
-
21624
- module.exports = Stream;
21625
-
21626
- var EE = require('events').EventEmitter;
21627
- var inherits = require('inherits');
21628
-
21629
- inherits(Stream, EE);
21630
- Stream.Readable = require('readable-stream/readable.js');
21631
- Stream.Writable = require('readable-stream/writable.js');
21632
- Stream.Duplex = require('readable-stream/duplex.js');
21633
- Stream.Transform = require('readable-stream/transform.js');
21634
- Stream.PassThrough = require('readable-stream/passthrough.js');
21635
-
21636
- // Backwards-compat with node 0.4.x
21637
- Stream.Stream = Stream;
21638
-
21639
-
21640
-
21641
- // old-style streams. Note that the pipe method (the only relevant
21642
- // part of this class) is overridden in the Readable class.
21643
-
21644
- function Stream() {
21645
- EE.call(this);
21646
- }
21647
-
21648
- Stream.prototype.pipe = function(dest, options) {
21649
- var source = this;
21650
-
21651
- function ondata(chunk) {
21652
- if (dest.writable) {
21653
- if (false === dest.write(chunk) && source.pause) {
21654
- source.pause();
21655
- }
21656
- }
21657
- }
21658
-
21659
- source.on('data', ondata);
21660
-
21661
- function ondrain() {
21662
- if (source.readable && source.resume) {
21663
- source.resume();
21664
- }
21665
- }
21666
-
21667
- dest.on('drain', ondrain);
21668
-
21669
- // If the 'end' option is not supplied, dest.end() will be called when
21670
- // source gets the 'end' or 'close' events. Only dest.end() once.
21671
- if (!dest._isStdio && (!options || options.end !== false)) {
21672
- source.on('end', onend);
21673
- source.on('close', onclose);
21674
- }
21675
-
21676
- var didOnEnd = false;
21677
- function onend() {
21678
- if (didOnEnd) return;
21679
- didOnEnd = true;
21680
-
21681
- dest.end();
21682
- }
21683
-
21684
-
21685
- function onclose() {
21686
- if (didOnEnd) return;
21687
- didOnEnd = true;
21688
-
21689
- if (typeof dest.destroy === 'function') dest.destroy();
21690
- }
21691
-
21692
- // don't leave dangling pipes when there are errors.
21693
- function onerror(er) {
21694
- cleanup();
21695
- if (EE.listenerCount(this, 'error') === 0) {
21696
- throw er; // Unhandled stream error in pipe.
21697
- }
21698
- }
21699
-
21700
- source.on('error', onerror);
21701
- dest.on('error', onerror);
21702
-
21703
- // remove all the event listeners that were added.
21704
- function cleanup() {
21705
- source.removeListener('data', ondata);
21706
- dest.removeListener('drain', ondrain);
21707
-
21708
- source.removeListener('end', onend);
21709
- source.removeListener('close', onclose);
21710
-
21711
- source.removeListener('error', onerror);
21712
- dest.removeListener('error', onerror);
21713
-
21714
- source.removeListener('end', cleanup);
21715
- source.removeListener('close', cleanup);
21716
-
21717
- dest.removeListener('close', cleanup);
21718
- }
21719
-
21720
- source.on('end', cleanup);
21721
- source.on('close', cleanup);
21722
-
21723
- dest.on('close', cleanup);
21724
-
21725
- dest.emit('pipe', source);
21726
-
21727
- // Allow for unix-like usage: A.pipe(B).pipe(C)
21728
- return dest;
21729
- };
21730
-
21731
- },{"events":43,"inherits":49,"readable-stream/duplex.js":65,"readable-stream/passthrough.js":74,"readable-stream/readable.js":75,"readable-stream/transform.js":76,"readable-stream/writable.js":77}],64:[function(require,module,exports){
21732
- arguments[4][40][0].apply(exports,arguments)
21733
- },{"dup":40}],65:[function(require,module,exports){
21734
21786
  module.exports = require('./lib/_stream_duplex.js');
21735
21787
 
21736
- },{"./lib/_stream_duplex.js":66}],66:[function(require,module,exports){
21788
+ },{"./lib/_stream_duplex.js":63}],63:[function(require,module,exports){
21737
21789
  // Copyright Joyent, Inc. and other Node contributors.
21738
21790
  //
21739
21791
  // Permission is hereby granted, free of charge, to any person obtaining a
@@ -21865,7 +21917,7 @@ Duplex.prototype._destroy = function (err, cb) {
21865
21917
 
21866
21918
  pna.nextTick(cb, err);
21867
21919
  };
21868
- },{"./_stream_readable":68,"./_stream_writable":70,"core-util-is":42,"inherits":49,"process-nextick-args":54}],67:[function(require,module,exports){
21920
+ },{"./_stream_readable":65,"./_stream_writable":67,"core-util-is":43,"inherits":71,"process-nextick-args":54}],64:[function(require,module,exports){
21869
21921
  // Copyright Joyent, Inc. and other Node contributors.
21870
21922
  //
21871
21923
  // Permission is hereby granted, free of charge, to any person obtaining a
@@ -21913,7 +21965,7 @@ function PassThrough(options) {
21913
21965
  PassThrough.prototype._transform = function (chunk, encoding, cb) {
21914
21966
  cb(null, chunk);
21915
21967
  };
21916
- },{"./_stream_transform":69,"core-util-is":42,"inherits":49}],68:[function(require,module,exports){
21968
+ },{"./_stream_transform":66,"core-util-is":43,"inherits":71}],65:[function(require,module,exports){
21917
21969
  (function (process,global){
21918
21970
  // Copyright Joyent, Inc. and other Node contributors.
21919
21971
  //
@@ -21970,7 +22022,7 @@ var Stream = require('./internal/streams/stream');
21970
22022
  /*<replacement>*/
21971
22023
 
21972
22024
  var Buffer = require('safe-buffer').Buffer;
21973
- var OurUint8Array = global.Uint8Array || function () {};
22025
+ var OurUint8Array = (typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}).Uint8Array || function () {};
21974
22026
  function _uint8ArrayToBuffer(chunk) {
21975
22027
  return Buffer.from(chunk);
21976
22028
  }
@@ -22540,8 +22592,8 @@ Readable.prototype.pipe = function (dest, pipeOpts) {
22540
22592
  // also returned false.
22541
22593
  // => Check whether `dest` is still a piping destination.
22542
22594
  if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
22543
- debug('false write response, pause', src._readableState.awaitDrain);
22544
- src._readableState.awaitDrain++;
22595
+ debug('false write response, pause', state.awaitDrain);
22596
+ state.awaitDrain++;
22545
22597
  increasedAwaitDrain = true;
22546
22598
  }
22547
22599
  src.pause();
@@ -22635,7 +22687,7 @@ Readable.prototype.unpipe = function (dest) {
22635
22687
  state.flowing = false;
22636
22688
 
22637
22689
  for (var i = 0; i < len; i++) {
22638
- dests[i].emit('unpipe', this, unpipeInfo);
22690
+ dests[i].emit('unpipe', this, { hasUnpiped: false });
22639
22691
  }return this;
22640
22692
  }
22641
22693
 
@@ -22935,7 +22987,7 @@ function indexOf(xs, x) {
22935
22987
  return -1;
22936
22988
  }
22937
22989
  }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
22938
- },{"./_stream_duplex":66,"./internal/streams/BufferList":71,"./internal/streams/destroy":72,"./internal/streams/stream":73,"_process":55,"core-util-is":42,"events":43,"inherits":49,"isarray":64,"process-nextick-args":54,"safe-buffer":78,"string_decoder/":79,"util":37}],69:[function(require,module,exports){
22990
+ },{"./_stream_duplex":63,"./internal/streams/BufferList":68,"./internal/streams/destroy":69,"./internal/streams/stream":70,"_process":55,"core-util-is":43,"events":44,"inherits":71,"isarray":72,"process-nextick-args":54,"safe-buffer":73,"string_decoder/":74,"util":38}],66:[function(require,module,exports){
22939
22991
  // Copyright Joyent, Inc. and other Node contributors.
22940
22992
  //
22941
22993
  // Permission is hereby granted, free of charge, to any person obtaining a
@@ -23150,7 +23202,7 @@ function done(stream, er, data) {
23150
23202
 
23151
23203
  return stream.push(null);
23152
23204
  }
23153
- },{"./_stream_duplex":66,"core-util-is":42,"inherits":49}],70:[function(require,module,exports){
23205
+ },{"./_stream_duplex":63,"core-util-is":43,"inherits":71}],67:[function(require,module,exports){
23154
23206
  (function (process,global){
23155
23207
  // Copyright Joyent, Inc. and other Node contributors.
23156
23208
  //
@@ -23235,7 +23287,7 @@ var Stream = require('./internal/streams/stream');
23235
23287
  /*<replacement>*/
23236
23288
 
23237
23289
  var Buffer = require('safe-buffer').Buffer;
23238
- var OurUint8Array = global.Uint8Array || function () {};
23290
+ var OurUint8Array = (typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}).Uint8Array || function () {};
23239
23291
  function _uint8ArrayToBuffer(chunk) {
23240
23292
  return Buffer.from(chunk);
23241
23293
  }
@@ -23503,7 +23555,7 @@ Writable.prototype.uncork = function () {
23503
23555
  if (state.corked) {
23504
23556
  state.corked--;
23505
23557
 
23506
- if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
23558
+ if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
23507
23559
  }
23508
23560
  };
23509
23561
 
@@ -23745,7 +23797,7 @@ Writable.prototype.end = function (chunk, encoding, cb) {
23745
23797
  }
23746
23798
 
23747
23799
  // ignore unnecessary end() calls.
23748
- if (!state.ending && !state.finished) endWritable(this, state, cb);
23800
+ if (!state.ending) endWritable(this, state, cb);
23749
23801
  };
23750
23802
 
23751
23803
  function needFinish(state) {
@@ -23806,11 +23858,9 @@ function onCorkedFinish(corkReq, state, err) {
23806
23858
  cb(err);
23807
23859
  entry = entry.next;
23808
23860
  }
23809
- if (state.corkedRequestsFree) {
23810
- state.corkedRequestsFree.next = corkReq;
23811
- } else {
23812
- state.corkedRequestsFree = corkReq;
23813
- }
23861
+
23862
+ // reuse the free corkReq.
23863
+ state.corkedRequestsFree.next = corkReq;
23814
23864
  }
23815
23865
 
23816
23866
  Object.defineProperty(Writable.prototype, 'destroyed', {
@@ -23840,7 +23890,7 @@ Writable.prototype._destroy = function (err, cb) {
23840
23890
  cb(err);
23841
23891
  };
23842
23892
  }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
23843
- },{"./_stream_duplex":66,"./internal/streams/destroy":72,"./internal/streams/stream":73,"_process":55,"core-util-is":42,"inherits":49,"process-nextick-args":54,"safe-buffer":78,"util-deprecate":89}],71:[function(require,module,exports){
23893
+ },{"./_stream_duplex":63,"./internal/streams/destroy":69,"./internal/streams/stream":70,"_process":55,"core-util-is":43,"inherits":71,"process-nextick-args":54,"safe-buffer":73,"util-deprecate":91}],68:[function(require,module,exports){
23844
23894
  'use strict';
23845
23895
 
23846
23896
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
@@ -23899,7 +23949,6 @@ module.exports = function () {
23899
23949
 
23900
23950
  BufferList.prototype.concat = function concat(n) {
23901
23951
  if (this.length === 0) return Buffer.alloc(0);
23902
- if (this.length === 1) return this.head.data;
23903
23952
  var ret = Buffer.allocUnsafe(n >>> 0);
23904
23953
  var p = this.head;
23905
23954
  var i = 0;
@@ -23920,7 +23969,7 @@ if (util && util.inspect && util.inspect.custom) {
23920
23969
  return this.constructor.name + ' ' + obj;
23921
23970
  };
23922
23971
  }
23923
- },{"safe-buffer":78,"util":37}],72:[function(require,module,exports){
23972
+ },{"safe-buffer":73,"util":38}],69:[function(require,module,exports){
23924
23973
  'use strict';
23925
23974
 
23926
23975
  /*<replacement>*/
@@ -23938,9 +23987,15 @@ function destroy(err, cb) {
23938
23987
  if (readableDestroyed || writableDestroyed) {
23939
23988
  if (cb) {
23940
23989
  cb(err);
23941
- } else if (err && (!this._writableState || !this._writableState.errorEmitted)) {
23942
- pna.nextTick(emitErrorNT, this, err);
23990
+ } else if (err) {
23991
+ if (!this._writableState) {
23992
+ pna.nextTick(emitErrorNT, this, err);
23993
+ } else if (!this._writableState.errorEmitted) {
23994
+ this._writableState.errorEmitted = true;
23995
+ pna.nextTick(emitErrorNT, this, err);
23996
+ }
23943
23997
  }
23998
+
23944
23999
  return this;
23945
24000
  }
23946
24001
 
@@ -23958,9 +24013,11 @@ function destroy(err, cb) {
23958
24013
 
23959
24014
  this._destroy(err || null, function (err) {
23960
24015
  if (!cb && err) {
23961
- pna.nextTick(emitErrorNT, _this, err);
23962
- if (_this._writableState) {
24016
+ if (!_this._writableState) {
24017
+ pna.nextTick(emitErrorNT, _this, err);
24018
+ } else if (!_this._writableState.errorEmitted) {
23963
24019
  _this._writableState.errorEmitted = true;
24020
+ pna.nextTick(emitErrorNT, _this, err);
23964
24021
  }
23965
24022
  } else if (cb) {
23966
24023
  cb(err);
@@ -23982,6 +24039,8 @@ function undestroy() {
23982
24039
  this._writableState.destroyed = false;
23983
24040
  this._writableState.ended = false;
23984
24041
  this._writableState.ending = false;
24042
+ this._writableState.finalCalled = false;
24043
+ this._writableState.prefinished = false;
23985
24044
  this._writableState.finished = false;
23986
24045
  this._writableState.errorEmitted = false;
23987
24046
  }
@@ -23995,28 +24054,41 @@ module.exports = {
23995
24054
  destroy: destroy,
23996
24055
  undestroy: undestroy
23997
24056
  };
23998
- },{"process-nextick-args":54}],73:[function(require,module,exports){
24057
+ },{"process-nextick-args":54}],70:[function(require,module,exports){
23999
24058
  module.exports = require('events').EventEmitter;
24000
24059
 
24001
- },{"events":43}],74:[function(require,module,exports){
24002
- module.exports = require('./readable').PassThrough
24003
-
24004
- },{"./readable":75}],75:[function(require,module,exports){
24005
- exports = module.exports = require('./lib/_stream_readable.js');
24006
- exports.Stream = exports;
24007
- exports.Readable = exports;
24008
- exports.Writable = require('./lib/_stream_writable.js');
24009
- exports.Duplex = require('./lib/_stream_duplex.js');
24010
- exports.Transform = require('./lib/_stream_transform.js');
24011
- exports.PassThrough = require('./lib/_stream_passthrough.js');
24012
-
24013
- },{"./lib/_stream_duplex.js":66,"./lib/_stream_passthrough.js":67,"./lib/_stream_readable.js":68,"./lib/_stream_transform.js":69,"./lib/_stream_writable.js":70}],76:[function(require,module,exports){
24014
- module.exports = require('./readable').Transform
24015
-
24016
- },{"./readable":75}],77:[function(require,module,exports){
24017
- module.exports = require('./lib/_stream_writable.js');
24060
+ },{"events":44}],71:[function(require,module,exports){
24061
+ if (typeof Object.create === 'function') {
24062
+ // implementation from standard node.js 'util' module
24063
+ module.exports = function inherits(ctor, superCtor) {
24064
+ if (superCtor) {
24065
+ ctor.super_ = superCtor
24066
+ ctor.prototype = Object.create(superCtor.prototype, {
24067
+ constructor: {
24068
+ value: ctor,
24069
+ enumerable: false,
24070
+ writable: true,
24071
+ configurable: true
24072
+ }
24073
+ })
24074
+ }
24075
+ };
24076
+ } else {
24077
+ // old school shim for old browsers
24078
+ module.exports = function inherits(ctor, superCtor) {
24079
+ if (superCtor) {
24080
+ ctor.super_ = superCtor
24081
+ var TempCtor = function () {}
24082
+ TempCtor.prototype = superCtor.prototype
24083
+ ctor.prototype = new TempCtor()
24084
+ ctor.prototype.constructor = ctor
24085
+ }
24086
+ }
24087
+ }
24018
24088
 
24019
- },{"./lib/_stream_writable.js":70}],78:[function(require,module,exports){
24089
+ },{}],72:[function(require,module,exports){
24090
+ arguments[4][40][0].apply(exports,arguments)
24091
+ },{"dup":40}],73:[function(require,module,exports){
24020
24092
  /* eslint-disable node/no-deprecated-api */
24021
24093
  var buffer = require('buffer')
24022
24094
  var Buffer = buffer.Buffer
@@ -24080,7 +24152,7 @@ SafeBuffer.allocUnsafeSlow = function (size) {
24080
24152
  return buffer.SlowBuffer(size)
24081
24153
  }
24082
24154
 
24083
- },{"buffer":39}],79:[function(require,module,exports){
24155
+ },{"buffer":39}],74:[function(require,module,exports){
24084
24156
  // Copyright Joyent, Inc. and other Node contributors.
24085
24157
  //
24086
24158
  // Permission is hereby granted, free of charge, to any person obtaining a
@@ -24377,7 +24449,181 @@ function simpleWrite(buf) {
24377
24449
  function simpleEnd(buf) {
24378
24450
  return buf && buf.length ? this.write(buf) : '';
24379
24451
  }
24380
- },{"safe-buffer":78}],80:[function(require,module,exports){
24452
+ },{"safe-buffer":73}],75:[function(require,module,exports){
24453
+ module.exports = require('./readable').PassThrough
24454
+
24455
+ },{"./readable":76}],76:[function(require,module,exports){
24456
+ exports = module.exports = require('./lib/_stream_readable.js');
24457
+ exports.Stream = exports;
24458
+ exports.Readable = exports;
24459
+ exports.Writable = require('./lib/_stream_writable.js');
24460
+ exports.Duplex = require('./lib/_stream_duplex.js');
24461
+ exports.Transform = require('./lib/_stream_transform.js');
24462
+ exports.PassThrough = require('./lib/_stream_passthrough.js');
24463
+
24464
+ },{"./lib/_stream_duplex.js":63,"./lib/_stream_passthrough.js":64,"./lib/_stream_readable.js":65,"./lib/_stream_transform.js":66,"./lib/_stream_writable.js":67}],77:[function(require,module,exports){
24465
+ module.exports = require('./readable').Transform
24466
+
24467
+ },{"./readable":76}],78:[function(require,module,exports){
24468
+ module.exports = require('./lib/_stream_writable.js');
24469
+
24470
+ },{"./lib/_stream_writable.js":67}],79:[function(require,module,exports){
24471
+
24472
+ /**
24473
+ * Reduce `arr` with `fn`.
24474
+ *
24475
+ * @param {Array} arr
24476
+ * @param {Function} fn
24477
+ * @param {Mixed} initial
24478
+ *
24479
+ * TODO: combatible error handling?
24480
+ */
24481
+
24482
+ module.exports = function(arr, fn, initial){
24483
+ var idx = 0;
24484
+ var len = arr.length;
24485
+ var curr = arguments.length == 3
24486
+ ? initial
24487
+ : arr[idx++];
24488
+
24489
+ while (idx < len) {
24490
+ curr = fn.call(null, curr, arr[idx], ++idx, arr);
24491
+ }
24492
+
24493
+ return curr;
24494
+ };
24495
+ },{}],80:[function(require,module,exports){
24496
+ // Copyright Joyent, Inc. and other Node contributors.
24497
+ //
24498
+ // Permission is hereby granted, free of charge, to any person obtaining a
24499
+ // copy of this software and associated documentation files (the
24500
+ // "Software"), to deal in the Software without restriction, including
24501
+ // without limitation the rights to use, copy, modify, merge, publish,
24502
+ // distribute, sublicense, and/or sell copies of the Software, and to permit
24503
+ // persons to whom the Software is furnished to do so, subject to the
24504
+ // following conditions:
24505
+ //
24506
+ // The above copyright notice and this permission notice shall be included
24507
+ // in all copies or substantial portions of the Software.
24508
+ //
24509
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24510
+ // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24511
+ // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
24512
+ // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
24513
+ // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24514
+ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
24515
+ // USE OR OTHER DEALINGS IN THE SOFTWARE.
24516
+
24517
+ module.exports = Stream;
24518
+
24519
+ var EE = require('events').EventEmitter;
24520
+ var inherits = require('inherits');
24521
+
24522
+ inherits(Stream, EE);
24523
+ Stream.Readable = require('readable-stream/readable.js');
24524
+ Stream.Writable = require('readable-stream/writable.js');
24525
+ Stream.Duplex = require('readable-stream/duplex.js');
24526
+ Stream.Transform = require('readable-stream/transform.js');
24527
+ Stream.PassThrough = require('readable-stream/passthrough.js');
24528
+
24529
+ // Backwards-compat with node 0.4.x
24530
+ Stream.Stream = Stream;
24531
+
24532
+
24533
+
24534
+ // old-style streams. Note that the pipe method (the only relevant
24535
+ // part of this class) is overridden in the Readable class.
24536
+
24537
+ function Stream() {
24538
+ EE.call(this);
24539
+ }
24540
+
24541
+ Stream.prototype.pipe = function(dest, options) {
24542
+ var source = this;
24543
+
24544
+ function ondata(chunk) {
24545
+ if (dest.writable) {
24546
+ if (false === dest.write(chunk) && source.pause) {
24547
+ source.pause();
24548
+ }
24549
+ }
24550
+ }
24551
+
24552
+ source.on('data', ondata);
24553
+
24554
+ function ondrain() {
24555
+ if (source.readable && source.resume) {
24556
+ source.resume();
24557
+ }
24558
+ }
24559
+
24560
+ dest.on('drain', ondrain);
24561
+
24562
+ // If the 'end' option is not supplied, dest.end() will be called when
24563
+ // source gets the 'end' or 'close' events. Only dest.end() once.
24564
+ if (!dest._isStdio && (!options || options.end !== false)) {
24565
+ source.on('end', onend);
24566
+ source.on('close', onclose);
24567
+ }
24568
+
24569
+ var didOnEnd = false;
24570
+ function onend() {
24571
+ if (didOnEnd) return;
24572
+ didOnEnd = true;
24573
+
24574
+ dest.end();
24575
+ }
24576
+
24577
+
24578
+ function onclose() {
24579
+ if (didOnEnd) return;
24580
+ didOnEnd = true;
24581
+
24582
+ if (typeof dest.destroy === 'function') dest.destroy();
24583
+ }
24584
+
24585
+ // don't leave dangling pipes when there are errors.
24586
+ function onerror(er) {
24587
+ cleanup();
24588
+ if (EE.listenerCount(this, 'error') === 0) {
24589
+ throw er; // Unhandled stream error in pipe.
24590
+ }
24591
+ }
24592
+
24593
+ source.on('error', onerror);
24594
+ dest.on('error', onerror);
24595
+
24596
+ // remove all the event listeners that were added.
24597
+ function cleanup() {
24598
+ source.removeListener('data', ondata);
24599
+ dest.removeListener('drain', ondrain);
24600
+
24601
+ source.removeListener('end', onend);
24602
+ source.removeListener('close', onclose);
24603
+
24604
+ source.removeListener('error', onerror);
24605
+ dest.removeListener('error', onerror);
24606
+
24607
+ source.removeListener('end', cleanup);
24608
+ source.removeListener('close', cleanup);
24609
+
24610
+ dest.removeListener('close', cleanup);
24611
+ }
24612
+
24613
+ source.on('end', cleanup);
24614
+ source.on('close', cleanup);
24615
+
24616
+ dest.on('close', cleanup);
24617
+
24618
+ dest.emit('pipe', source);
24619
+
24620
+ // Allow for unix-like usage: A.pipe(B).pipe(C)
24621
+ return dest;
24622
+ };
24623
+
24624
+ },{"events":44,"inherits":81,"readable-stream/duplex.js":62,"readable-stream/passthrough.js":75,"readable-stream/readable.js":76,"readable-stream/transform.js":77,"readable-stream/writable.js":78}],81:[function(require,module,exports){
24625
+ arguments[4][71][0].apply(exports,arguments)
24626
+ },{"dup":71}],82:[function(require,module,exports){
24381
24627
  var ClientRequest = require('./lib/request')
24382
24628
  var extend = require('xtend')
24383
24629
  var statusCodes = require('builtin-status-codes')
@@ -24452,7 +24698,7 @@ http.METHODS = [
24452
24698
  'UNLOCK',
24453
24699
  'UNSUBSCRIBE'
24454
24700
  ]
24455
- },{"./lib/request":82,"builtin-status-codes":41,"url":88,"xtend":92}],81:[function(require,module,exports){
24701
+ },{"./lib/request":84,"builtin-status-codes":41,"url":90,"xtend":94}],83:[function(require,module,exports){
24456
24702
  (function (global){
24457
24703
  exports.fetch = isFunction(global.fetch) && isFunction(global.ReadableByteStream)
24458
24704
 
@@ -24496,7 +24742,7 @@ function isFunction (value) {
24496
24742
  xhr = null // Help gc
24497
24743
 
24498
24744
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
24499
- },{}],82:[function(require,module,exports){
24745
+ },{}],84:[function(require,module,exports){
24500
24746
  (function (process,global,Buffer){
24501
24747
  // var Base64 = require('Base64')
24502
24748
  var capability = require('./capability')
@@ -24778,7 +25024,7 @@ var unsafeHeaders = [
24778
25024
  ]
24779
25025
 
24780
25026
  }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("buffer").Buffer)
24781
- },{"./capability":81,"./response":83,"_process":55,"buffer":39,"foreach":45,"indexof":48,"inherits":49,"object-keys":51,"stream":63}],83:[function(require,module,exports){
25027
+ },{"./capability":83,"./response":85,"_process":55,"buffer":39,"foreach":46,"indexof":49,"inherits":86,"object-keys":51,"stream":80}],85:[function(require,module,exports){
24782
25028
  (function (process,global,Buffer){
24783
25029
  var capability = require('./capability')
24784
25030
  var foreach = require('foreach')
@@ -24955,7 +25201,9 @@ IncomingMessage.prototype._onXHRProgress = function () {
24955
25201
  }
24956
25202
 
24957
25203
  }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("buffer").Buffer)
24958
- },{"./capability":81,"_process":55,"buffer":39,"foreach":45,"inherits":49,"stream":63}],84:[function(require,module,exports){
25204
+ },{"./capability":83,"_process":55,"buffer":39,"foreach":46,"inherits":86,"stream":80}],86:[function(require,module,exports){
25205
+ arguments[4][71][0].apply(exports,arguments)
25206
+ },{"dup":71}],87:[function(require,module,exports){
24959
25207
  var nargs = /\{([0-9a-zA-Z_]+)\}/g
24960
25208
 
24961
25209
  module.exports = template
@@ -24993,7 +25241,7 @@ function template(string) {
24993
25241
  })
24994
25242
  }
24995
25243
 
24996
- },{}],85:[function(require,module,exports){
25244
+ },{}],88:[function(require,module,exports){
24997
25245
  /**
24998
25246
  * Module dependencies.
24999
25247
  */
@@ -26186,172 +26434,7 @@ request.put = function(url, data, fn){
26186
26434
 
26187
26435
  module.exports = request;
26188
26436
 
26189
- },{"emitter":86,"reduce":62}],86:[function(require,module,exports){
26190
-
26191
- /**
26192
- * Expose `Emitter`.
26193
- */
26194
-
26195
- if (typeof module !== 'undefined') {
26196
- module.exports = Emitter;
26197
- }
26198
-
26199
- /**
26200
- * Initialize a new `Emitter`.
26201
- *
26202
- * @api public
26203
- */
26204
-
26205
- function Emitter(obj) {
26206
- if (obj) return mixin(obj);
26207
- };
26208
-
26209
- /**
26210
- * Mixin the emitter properties.
26211
- *
26212
- * @param {Object} obj
26213
- * @return {Object}
26214
- * @api private
26215
- */
26216
-
26217
- function mixin(obj) {
26218
- for (var key in Emitter.prototype) {
26219
- obj[key] = Emitter.prototype[key];
26220
- }
26221
- return obj;
26222
- }
26223
-
26224
- /**
26225
- * Listen on the given `event` with `fn`.
26226
- *
26227
- * @param {String} event
26228
- * @param {Function} fn
26229
- * @return {Emitter}
26230
- * @api public
26231
- */
26232
-
26233
- Emitter.prototype.on =
26234
- Emitter.prototype.addEventListener = function(event, fn){
26235
- this._callbacks = this._callbacks || {};
26236
- (this._callbacks['$' + event] = this._callbacks['$' + event] || [])
26237
- .push(fn);
26238
- return this;
26239
- };
26240
-
26241
- /**
26242
- * Adds an `event` listener that will be invoked a single
26243
- * time then automatically removed.
26244
- *
26245
- * @param {String} event
26246
- * @param {Function} fn
26247
- * @return {Emitter}
26248
- * @api public
26249
- */
26250
-
26251
- Emitter.prototype.once = function(event, fn){
26252
- function on() {
26253
- this.off(event, on);
26254
- fn.apply(this, arguments);
26255
- }
26256
-
26257
- on.fn = fn;
26258
- this.on(event, on);
26259
- return this;
26260
- };
26261
-
26262
- /**
26263
- * Remove the given callback for `event` or all
26264
- * registered callbacks.
26265
- *
26266
- * @param {String} event
26267
- * @param {Function} fn
26268
- * @return {Emitter}
26269
- * @api public
26270
- */
26271
-
26272
- Emitter.prototype.off =
26273
- Emitter.prototype.removeListener =
26274
- Emitter.prototype.removeAllListeners =
26275
- Emitter.prototype.removeEventListener = function(event, fn){
26276
- this._callbacks = this._callbacks || {};
26277
-
26278
- // all
26279
- if (0 == arguments.length) {
26280
- this._callbacks = {};
26281
- return this;
26282
- }
26283
-
26284
- // specific event
26285
- var callbacks = this._callbacks['$' + event];
26286
- if (!callbacks) return this;
26287
-
26288
- // remove all handlers
26289
- if (1 == arguments.length) {
26290
- delete this._callbacks['$' + event];
26291
- return this;
26292
- }
26293
-
26294
- // remove specific handler
26295
- var cb;
26296
- for (var i = 0; i < callbacks.length; i++) {
26297
- cb = callbacks[i];
26298
- if (cb === fn || cb.fn === fn) {
26299
- callbacks.splice(i, 1);
26300
- break;
26301
- }
26302
- }
26303
- return this;
26304
- };
26305
-
26306
- /**
26307
- * Emit `event` with the given args.
26308
- *
26309
- * @param {String} event
26310
- * @param {Mixed} ...
26311
- * @return {Emitter}
26312
- */
26313
-
26314
- Emitter.prototype.emit = function(event){
26315
- this._callbacks = this._callbacks || {};
26316
- var args = [].slice.call(arguments, 1)
26317
- , callbacks = this._callbacks['$' + event];
26318
-
26319
- if (callbacks) {
26320
- callbacks = callbacks.slice(0);
26321
- for (var i = 0, len = callbacks.length; i < len; ++i) {
26322
- callbacks[i].apply(this, args);
26323
- }
26324
- }
26325
-
26326
- return this;
26327
- };
26328
-
26329
- /**
26330
- * Return array of callbacks for `event`.
26331
- *
26332
- * @param {String} event
26333
- * @return {Array}
26334
- * @api public
26335
- */
26336
-
26337
- Emitter.prototype.listeners = function(event){
26338
- this._callbacks = this._callbacks || {};
26339
- return this._callbacks['$' + event] || [];
26340
- };
26341
-
26342
- /**
26343
- * Check if this emitter has `event` handlers.
26344
- *
26345
- * @param {String} event
26346
- * @return {Boolean}
26347
- * @api public
26348
- */
26349
-
26350
- Emitter.prototype.hasListeners = function(event){
26351
- return !! this.listeners(event).length;
26352
- };
26353
-
26354
- },{}],87:[function(require,module,exports){
26437
+ },{"emitter":42,"reduce":79}],89:[function(require,module,exports){
26355
26438
  (function (Buffer){
26356
26439
  "0.50.0";
26357
26440
  /*
@@ -34548,7 +34631,7 @@ TinCan client library
34548
34631
  }());
34549
34632
 
34550
34633
  }).call(this,require("buffer").Buffer)
34551
- },{"buffer":39,"querystring":61,"xhr2":91}],88:[function(require,module,exports){
34634
+ },{"buffer":39,"querystring":61,"xhr2":93}],90:[function(require,module,exports){
34552
34635
  // Copyright Joyent, Inc. and other Node contributors.
34553
34636
  //
34554
34637
  // Permission is hereby granted, free of charge, to any person obtaining a
@@ -35257,7 +35340,7 @@ function isNullOrUndefined(arg) {
35257
35340
  return arg == null;
35258
35341
  }
35259
35342
 
35260
- },{"punycode":57,"querystring":61}],89:[function(require,module,exports){
35343
+ },{"punycode":57,"querystring":61}],91:[function(require,module,exports){
35261
35344
  (function (global){
35262
35345
 
35263
35346
  /**
@@ -35328,7 +35411,7 @@ function config (name) {
35328
35411
  }
35329
35412
 
35330
35413
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
35331
- },{}],90:[function(require,module,exports){
35414
+ },{}],92:[function(require,module,exports){
35332
35415
  /*!
35333
35416
  * validate.js 0.9.0
35334
35417
  *
@@ -36416,7 +36499,7 @@ function config (name) {
36416
36499
  typeof module !== 'undefined' ? /* istanbul ignore next */ module : null,
36417
36500
  typeof define !== 'undefined' ? /* istanbul ignore next */ define : null);
36418
36501
 
36419
- },{}],91:[function(require,module,exports){
36502
+ },{}],93:[function(require,module,exports){
36420
36503
  (function (process,Buffer){
36421
36504
  // Generated by CoffeeScript 1.6.3
36422
36505
  (function() {
@@ -37254,7 +37337,7 @@ function config (name) {
37254
37337
  }).call(this);
37255
37338
 
37256
37339
  }).call(this,require('_process'),require("buffer").Buffer)
37257
- },{"_process":55,"buffer":39,"http":80,"https":46,"os":53,"url":88}],92:[function(require,module,exports){
37340
+ },{"_process":55,"buffer":39,"http":82,"https":47,"os":53,"url":90}],94:[function(require,module,exports){
37258
37341
  module.exports = extend
37259
37342
 
37260
37343
  var hasOwnProperty = Object.prototype.hasOwnProperty;