@sap/ux-ui5-tooling 1.3.5 → 1.4.3
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.
- package/CHANGELOG.md +23 -0
- package/README.md +5 -5
- package/dist/cli/index.js +116935 -104790
- package/dist/markdowns/add/add.en.md +3 -0
- package/dist/markdowns/deploy/deploy.en.md +1 -0
- package/dist/middlewares/fiori-tools-appreload.js +2137 -1835
- package/dist/middlewares/fiori-tools-preview.js +5001 -4919
- package/dist/middlewares/fiori-tools-proxy.js +8252 -8163
- package/dist/middlewares/fiori-tools-servestatic.js +1 -1
- package/dist/tasks/cf-deploy/index.js +22015 -6812
- package/dist/tasks/deploy/index.js +75446 -60204
- package/dist/templates/control-property-editor/app.js +1 -1
- package/dist/templates/control-property-editor/editor.html +1 -1
- package/dist/templates/control-property-editor/favicon.ico +0 -0
- package/dist/templates/control-property-editor/ui5-adaptation.js +1 -1
- package/dist/templates/control-property-editor/vendor.js +1 -1
- package/dist/templates/control-property-editor/vendor.js.LICENSE.txt +7 -0
- package/dist/templates/variants-management/preview.html +2 -1
- package/package.json +10 -8
|
@@ -22950,628 +22950,147 @@ function createConnectionSSL (port, host, options) {
|
|
|
22950
22950
|
|
|
22951
22951
|
/***/ }),
|
|
22952
22952
|
|
|
22953
|
-
/***/
|
|
22953
|
+
/***/ 74608:
|
|
22954
22954
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
22955
22955
|
|
|
22956
|
-
|
|
22957
|
-
var util = __webpack_require__(31669);
|
|
22958
|
-
var path = __webpack_require__(85622);
|
|
22959
|
-
var http = __webpack_require__(98605);
|
|
22960
|
-
var https = __webpack_require__(57211);
|
|
22961
|
-
var parseUrl = __webpack_require__(78835).parse;
|
|
22962
|
-
var fs = __webpack_require__(35747);
|
|
22963
|
-
var mime = __webpack_require__(19010);
|
|
22964
|
-
var asynckit = __webpack_require__(48564);
|
|
22965
|
-
var populate = __webpack_require__(10453);
|
|
22966
|
-
|
|
22967
|
-
// Public API
|
|
22968
|
-
module.exports = FormData;
|
|
22969
|
-
|
|
22970
|
-
// make it a Stream
|
|
22971
|
-
util.inherits(FormData, CombinedStream);
|
|
22972
|
-
|
|
22973
|
-
/**
|
|
22974
|
-
* Create readable "multipart/form-data" streams.
|
|
22975
|
-
* Can be used to submit forms
|
|
22976
|
-
* and file uploads to other web applications.
|
|
22977
|
-
*
|
|
22978
|
-
* @constructor
|
|
22979
|
-
* @param {Object} options - Properties to be added/overriden for FormData and CombinedStream
|
|
22980
|
-
*/
|
|
22981
|
-
function FormData(options) {
|
|
22982
|
-
if (!(this instanceof FormData)) {
|
|
22983
|
-
return new FormData();
|
|
22984
|
-
}
|
|
22985
|
-
|
|
22986
|
-
this._overheadLength = 0;
|
|
22987
|
-
this._valueLength = 0;
|
|
22988
|
-
this._valuesToMeasure = [];
|
|
22956
|
+
"use strict";
|
|
22989
22957
|
|
|
22990
|
-
|
|
22958
|
+
var spin = __webpack_require__(74365)
|
|
22959
|
+
var progressBar = __webpack_require__(8936)
|
|
22991
22960
|
|
|
22992
|
-
|
|
22993
|
-
|
|
22994
|
-
|
|
22961
|
+
module.exports = {
|
|
22962
|
+
activityIndicator: function (values, theme, width) {
|
|
22963
|
+
if (values.spun == null) return
|
|
22964
|
+
return spin(theme, values.spun)
|
|
22965
|
+
},
|
|
22966
|
+
progressbar: function (values, theme, width) {
|
|
22967
|
+
if (values.completed == null) return
|
|
22968
|
+
return progressBar(theme, width, values.completed)
|
|
22995
22969
|
}
|
|
22996
22970
|
}
|
|
22997
22971
|
|
|
22998
|
-
FormData.LINE_BREAK = '\r\n';
|
|
22999
|
-
FormData.DEFAULT_CONTENT_TYPE = 'application/octet-stream';
|
|
23000
|
-
|
|
23001
|
-
FormData.prototype.append = function(field, value, options) {
|
|
23002
|
-
|
|
23003
|
-
options = options || {};
|
|
23004
|
-
|
|
23005
|
-
// allow filename as single option
|
|
23006
|
-
if (typeof options == 'string') {
|
|
23007
|
-
options = {filename: options};
|
|
23008
|
-
}
|
|
23009
22972
|
|
|
23010
|
-
|
|
22973
|
+
/***/ }),
|
|
23011
22974
|
|
|
23012
|
-
|
|
23013
|
-
|
|
23014
|
-
value = '' + value;
|
|
23015
|
-
}
|
|
22975
|
+
/***/ 15591:
|
|
22976
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
23016
22977
|
|
|
23017
|
-
|
|
23018
|
-
if (util.isArray(value)) {
|
|
23019
|
-
// Please convert your array into string
|
|
23020
|
-
// the way web server expects it
|
|
23021
|
-
this._error(new Error('Arrays are not supported.'));
|
|
23022
|
-
return;
|
|
23023
|
-
}
|
|
22978
|
+
"use strict";
|
|
23024
22979
|
|
|
23025
|
-
|
|
23026
|
-
var footer = this._multiPartFooter();
|
|
22980
|
+
var util = __webpack_require__(31669)
|
|
23027
22981
|
|
|
23028
|
-
|
|
23029
|
-
|
|
23030
|
-
|
|
22982
|
+
var User = exports.User = function User (msg) {
|
|
22983
|
+
var err = new Error(msg)
|
|
22984
|
+
Error.captureStackTrace(err, User)
|
|
22985
|
+
err.code = 'EGAUGE'
|
|
22986
|
+
return err
|
|
22987
|
+
}
|
|
23031
22988
|
|
|
23032
|
-
|
|
23033
|
-
|
|
23034
|
-
|
|
22989
|
+
exports.MissingTemplateValue = function MissingTemplateValue (item, values) {
|
|
22990
|
+
var err = new User(util.format('Missing template value "%s"', item.type))
|
|
22991
|
+
Error.captureStackTrace(err, MissingTemplateValue)
|
|
22992
|
+
err.template = item
|
|
22993
|
+
err.values = values
|
|
22994
|
+
return err
|
|
22995
|
+
}
|
|
23035
22996
|
|
|
23036
|
-
|
|
23037
|
-
var
|
|
22997
|
+
exports.Internal = function Internal (msg) {
|
|
22998
|
+
var err = new Error(msg)
|
|
22999
|
+
Error.captureStackTrace(err, Internal)
|
|
23000
|
+
err.code = 'EGAUGEINTERNAL'
|
|
23001
|
+
return err
|
|
23002
|
+
}
|
|
23038
23003
|
|
|
23039
|
-
// used w/ getLengthSync(), when length is known.
|
|
23040
|
-
// e.g. for streaming directly from a remote server,
|
|
23041
|
-
// w/ a known file a size, and not wanting to wait for
|
|
23042
|
-
// incoming file to finish to get its size.
|
|
23043
|
-
if (options.knownLength != null) {
|
|
23044
|
-
valueLength += +options.knownLength;
|
|
23045
|
-
} else if (Buffer.isBuffer(value)) {
|
|
23046
|
-
valueLength = value.length;
|
|
23047
|
-
} else if (typeof value === 'string') {
|
|
23048
|
-
valueLength = Buffer.byteLength(value);
|
|
23049
|
-
}
|
|
23050
23004
|
|
|
23051
|
-
|
|
23005
|
+
/***/ }),
|
|
23052
23006
|
|
|
23053
|
-
|
|
23054
|
-
|
|
23055
|
-
Buffer.byteLength(header) +
|
|
23056
|
-
FormData.LINE_BREAK.length;
|
|
23007
|
+
/***/ 18029:
|
|
23008
|
+
/***/ ((module) => {
|
|
23057
23009
|
|
|
23058
|
-
|
|
23059
|
-
if (!value || ( !value.path && !(value.readable && value.hasOwnProperty('httpVersion')) )) {
|
|
23060
|
-
return;
|
|
23061
|
-
}
|
|
23010
|
+
"use strict";
|
|
23062
23011
|
|
|
23063
|
-
// no need to bother with the length
|
|
23064
|
-
if (!options.knownLength) {
|
|
23065
|
-
this._valuesToMeasure.push(value);
|
|
23066
|
-
}
|
|
23067
|
-
};
|
|
23068
23012
|
|
|
23069
|
-
|
|
23013
|
+
module.exports = isWin32() || isColorTerm()
|
|
23070
23014
|
|
|
23071
|
-
|
|
23015
|
+
function isWin32 () {
|
|
23016
|
+
return process.platform === 'win32'
|
|
23017
|
+
}
|
|
23072
23018
|
|
|
23073
|
-
|
|
23074
|
-
|
|
23075
|
-
|
|
23076
|
-
|
|
23077
|
-
// it doesn't respect `end` options without `start` options
|
|
23078
|
-
// Fix it when node fixes it.
|
|
23079
|
-
// https://github.com/joyent/node/issues/7819
|
|
23080
|
-
if (value.end != undefined && value.end != Infinity && value.start != undefined) {
|
|
23019
|
+
function isColorTerm () {
|
|
23020
|
+
var termHasColor = /^screen|^xterm|^vt100|color|ansi|cygwin|linux/i
|
|
23021
|
+
return !!process.env.COLORTERM || termHasColor.test(process.env.TERM)
|
|
23022
|
+
}
|
|
23081
23023
|
|
|
23082
|
-
// when end specified
|
|
23083
|
-
// no need to calculate range
|
|
23084
|
-
// inclusive, starts with 0
|
|
23085
|
-
callback(null, value.end + 1 - (value.start ? value.start : 0));
|
|
23086
23024
|
|
|
23087
|
-
|
|
23088
|
-
} else {
|
|
23089
|
-
// still need to fetch file size from fs
|
|
23090
|
-
fs.stat(value.path, function(err, stat) {
|
|
23025
|
+
/***/ }),
|
|
23091
23026
|
|
|
23092
|
-
|
|
23027
|
+
/***/ 1757:
|
|
23028
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
23093
23029
|
|
|
23094
|
-
|
|
23095
|
-
callback(err);
|
|
23096
|
-
return;
|
|
23097
|
-
}
|
|
23030
|
+
"use strict";
|
|
23098
23031
|
|
|
23099
|
-
|
|
23100
|
-
|
|
23101
|
-
|
|
23102
|
-
|
|
23103
|
-
|
|
23032
|
+
var Plumbing = __webpack_require__(17852)
|
|
23033
|
+
var hasUnicode = __webpack_require__(29253)
|
|
23034
|
+
var hasColor = __webpack_require__(18029)
|
|
23035
|
+
var onExit = __webpack_require__(40412)
|
|
23036
|
+
var defaultThemes = __webpack_require__(62834)
|
|
23037
|
+
var setInterval = __webpack_require__(29165)
|
|
23038
|
+
var process = __webpack_require__(22156)
|
|
23039
|
+
var setImmediate = __webpack_require__(48761)
|
|
23104
23040
|
|
|
23105
|
-
|
|
23106
|
-
} else if (value.hasOwnProperty('httpVersion')) {
|
|
23107
|
-
callback(null, +value.headers['content-length']);
|
|
23041
|
+
module.exports = Gauge
|
|
23108
23042
|
|
|
23109
|
-
|
|
23110
|
-
|
|
23111
|
-
|
|
23112
|
-
|
|
23113
|
-
|
|
23114
|
-
callback(null, +response.headers['content-length']);
|
|
23115
|
-
});
|
|
23116
|
-
value.resume();
|
|
23043
|
+
function callWith (obj, method) {
|
|
23044
|
+
return function () {
|
|
23045
|
+
return method.call(obj)
|
|
23046
|
+
}
|
|
23047
|
+
}
|
|
23117
23048
|
|
|
23118
|
-
|
|
23049
|
+
function Gauge (arg1, arg2) {
|
|
23050
|
+
var options, writeTo
|
|
23051
|
+
if (arg1 && arg1.write) {
|
|
23052
|
+
writeTo = arg1
|
|
23053
|
+
options = arg2 || {}
|
|
23054
|
+
} else if (arg2 && arg2.write) {
|
|
23055
|
+
writeTo = arg2
|
|
23056
|
+
options = arg1 || {}
|
|
23119
23057
|
} else {
|
|
23120
|
-
|
|
23058
|
+
writeTo = process.stderr
|
|
23059
|
+
options = arg1 || arg2 || {}
|
|
23121
23060
|
}
|
|
23122
|
-
};
|
|
23123
23061
|
|
|
23124
|
-
|
|
23125
|
-
|
|
23126
|
-
|
|
23127
|
-
|
|
23128
|
-
if (typeof options.header == 'string') {
|
|
23129
|
-
return options.header;
|
|
23062
|
+
this._status = {
|
|
23063
|
+
spun: 0,
|
|
23064
|
+
section: '',
|
|
23065
|
+
subsection: ''
|
|
23130
23066
|
}
|
|
23067
|
+
this._paused = false // are we paused for back pressure?
|
|
23068
|
+
this._disabled = true // are all progress bar updates disabled?
|
|
23069
|
+
this._showing = false // do we WANT the progress bar on screen
|
|
23070
|
+
this._onScreen = false // IS the progress bar on screen
|
|
23071
|
+
this._needsRedraw = false // should we print something at next tick?
|
|
23072
|
+
this._hideCursor = options.hideCursor == null ? true : options.hideCursor
|
|
23073
|
+
this._fixedFramerate = options.fixedFramerate == null
|
|
23074
|
+
? !(/^v0\.8\./.test(process.version))
|
|
23075
|
+
: options.fixedFramerate
|
|
23076
|
+
this._lastUpdateAt = null
|
|
23077
|
+
this._updateInterval = options.updateInterval == null ? 50 : options.updateInterval
|
|
23131
23078
|
|
|
23132
|
-
|
|
23133
|
-
|
|
23079
|
+
this._themes = options.themes || defaultThemes
|
|
23080
|
+
this._theme = options.theme
|
|
23081
|
+
var theme = this._computeTheme(options.theme)
|
|
23082
|
+
var template = options.template || [
|
|
23083
|
+
{type: 'progressbar', length: 20},
|
|
23084
|
+
{type: 'activityIndicator', kerning: 1, length: 1},
|
|
23085
|
+
{type: 'section', kerning: 1, default: ''},
|
|
23086
|
+
{type: 'subsection', kerning: 1, default: ''}
|
|
23087
|
+
]
|
|
23088
|
+
this.setWriteTo(writeTo, options.tty)
|
|
23089
|
+
var PlumbingClass = options.Plumbing || Plumbing
|
|
23090
|
+
this._gauge = new PlumbingClass(theme, template, this.getWidth())
|
|
23134
23091
|
|
|
23135
|
-
|
|
23136
|
-
|
|
23137
|
-
// add custom disposition as third element or keep it two elements if not
|
|
23138
|
-
'Content-Disposition': ['form-data', 'name="' + field + '"'].concat(contentDisposition || []),
|
|
23139
|
-
// if no content type. allow it to be empty array
|
|
23140
|
-
'Content-Type': [].concat(contentType || [])
|
|
23141
|
-
};
|
|
23142
|
-
|
|
23143
|
-
// allow custom headers.
|
|
23144
|
-
if (typeof options.header == 'object') {
|
|
23145
|
-
populate(headers, options.header);
|
|
23146
|
-
}
|
|
23147
|
-
|
|
23148
|
-
var header;
|
|
23149
|
-
for (var prop in headers) {
|
|
23150
|
-
if (!headers.hasOwnProperty(prop)) continue;
|
|
23151
|
-
header = headers[prop];
|
|
23152
|
-
|
|
23153
|
-
// skip nullish headers.
|
|
23154
|
-
if (header == null) {
|
|
23155
|
-
continue;
|
|
23156
|
-
}
|
|
23157
|
-
|
|
23158
|
-
// convert all headers to arrays.
|
|
23159
|
-
if (!Array.isArray(header)) {
|
|
23160
|
-
header = [header];
|
|
23161
|
-
}
|
|
23162
|
-
|
|
23163
|
-
// add non-empty headers.
|
|
23164
|
-
if (header.length) {
|
|
23165
|
-
contents += prop + ': ' + header.join('; ') + FormData.LINE_BREAK;
|
|
23166
|
-
}
|
|
23167
|
-
}
|
|
23168
|
-
|
|
23169
|
-
return '--' + this.getBoundary() + FormData.LINE_BREAK + contents + FormData.LINE_BREAK;
|
|
23170
|
-
};
|
|
23171
|
-
|
|
23172
|
-
FormData.prototype._getContentDisposition = function(value, options) {
|
|
23173
|
-
|
|
23174
|
-
var filename
|
|
23175
|
-
, contentDisposition
|
|
23176
|
-
;
|
|
23177
|
-
|
|
23178
|
-
if (typeof options.filepath === 'string') {
|
|
23179
|
-
// custom filepath for relative paths
|
|
23180
|
-
filename = path.normalize(options.filepath).replace(/\\/g, '/');
|
|
23181
|
-
} else if (options.filename || value.name || value.path) {
|
|
23182
|
-
// custom filename take precedence
|
|
23183
|
-
// formidable and the browser add a name property
|
|
23184
|
-
// fs- and request- streams have path property
|
|
23185
|
-
filename = path.basename(options.filename || value.name || value.path);
|
|
23186
|
-
} else if (value.readable && value.hasOwnProperty('httpVersion')) {
|
|
23187
|
-
// or try http response
|
|
23188
|
-
filename = path.basename(value.client._httpMessage.path);
|
|
23189
|
-
}
|
|
23190
|
-
|
|
23191
|
-
if (filename) {
|
|
23192
|
-
contentDisposition = 'filename="' + filename + '"';
|
|
23193
|
-
}
|
|
23194
|
-
|
|
23195
|
-
return contentDisposition;
|
|
23196
|
-
};
|
|
23197
|
-
|
|
23198
|
-
FormData.prototype._getContentType = function(value, options) {
|
|
23199
|
-
|
|
23200
|
-
// use custom content-type above all
|
|
23201
|
-
var contentType = options.contentType;
|
|
23202
|
-
|
|
23203
|
-
// or try `name` from formidable, browser
|
|
23204
|
-
if (!contentType && value.name) {
|
|
23205
|
-
contentType = mime.lookup(value.name);
|
|
23206
|
-
}
|
|
23207
|
-
|
|
23208
|
-
// or try `path` from fs-, request- streams
|
|
23209
|
-
if (!contentType && value.path) {
|
|
23210
|
-
contentType = mime.lookup(value.path);
|
|
23211
|
-
}
|
|
23212
|
-
|
|
23213
|
-
// or if it's http-reponse
|
|
23214
|
-
if (!contentType && value.readable && value.hasOwnProperty('httpVersion')) {
|
|
23215
|
-
contentType = value.headers['content-type'];
|
|
23216
|
-
}
|
|
23217
|
-
|
|
23218
|
-
// or guess it from the filepath or filename
|
|
23219
|
-
if (!contentType && (options.filepath || options.filename)) {
|
|
23220
|
-
contentType = mime.lookup(options.filepath || options.filename);
|
|
23221
|
-
}
|
|
23222
|
-
|
|
23223
|
-
// fallback to the default content type if `value` is not simple value
|
|
23224
|
-
if (!contentType && typeof value == 'object') {
|
|
23225
|
-
contentType = FormData.DEFAULT_CONTENT_TYPE;
|
|
23226
|
-
}
|
|
23227
|
-
|
|
23228
|
-
return contentType;
|
|
23229
|
-
};
|
|
23230
|
-
|
|
23231
|
-
FormData.prototype._multiPartFooter = function() {
|
|
23232
|
-
return function(next) {
|
|
23233
|
-
var footer = FormData.LINE_BREAK;
|
|
23234
|
-
|
|
23235
|
-
var lastPart = (this._streams.length === 0);
|
|
23236
|
-
if (lastPart) {
|
|
23237
|
-
footer += this._lastBoundary();
|
|
23238
|
-
}
|
|
23239
|
-
|
|
23240
|
-
next(footer);
|
|
23241
|
-
}.bind(this);
|
|
23242
|
-
};
|
|
23243
|
-
|
|
23244
|
-
FormData.prototype._lastBoundary = function() {
|
|
23245
|
-
return '--' + this.getBoundary() + '--' + FormData.LINE_BREAK;
|
|
23246
|
-
};
|
|
23247
|
-
|
|
23248
|
-
FormData.prototype.getHeaders = function(userHeaders) {
|
|
23249
|
-
var header;
|
|
23250
|
-
var formHeaders = {
|
|
23251
|
-
'content-type': 'multipart/form-data; boundary=' + this.getBoundary()
|
|
23252
|
-
};
|
|
23253
|
-
|
|
23254
|
-
for (header in userHeaders) {
|
|
23255
|
-
if (userHeaders.hasOwnProperty(header)) {
|
|
23256
|
-
formHeaders[header.toLowerCase()] = userHeaders[header];
|
|
23257
|
-
}
|
|
23258
|
-
}
|
|
23259
|
-
|
|
23260
|
-
return formHeaders;
|
|
23261
|
-
};
|
|
23262
|
-
|
|
23263
|
-
FormData.prototype.getBoundary = function() {
|
|
23264
|
-
if (!this._boundary) {
|
|
23265
|
-
this._generateBoundary();
|
|
23266
|
-
}
|
|
23267
|
-
|
|
23268
|
-
return this._boundary;
|
|
23269
|
-
};
|
|
23270
|
-
|
|
23271
|
-
FormData.prototype._generateBoundary = function() {
|
|
23272
|
-
// This generates a 50 character boundary similar to those used by Firefox.
|
|
23273
|
-
// They are optimized for boyer-moore parsing.
|
|
23274
|
-
var boundary = '--------------------------';
|
|
23275
|
-
for (var i = 0; i < 24; i++) {
|
|
23276
|
-
boundary += Math.floor(Math.random() * 10).toString(16);
|
|
23277
|
-
}
|
|
23278
|
-
|
|
23279
|
-
this._boundary = boundary;
|
|
23280
|
-
};
|
|
23281
|
-
|
|
23282
|
-
// Note: getLengthSync DOESN'T calculate streams length
|
|
23283
|
-
// As workaround one can calculate file size manually
|
|
23284
|
-
// and add it as knownLength option
|
|
23285
|
-
FormData.prototype.getLengthSync = function() {
|
|
23286
|
-
var knownLength = this._overheadLength + this._valueLength;
|
|
23287
|
-
|
|
23288
|
-
// Don't get confused, there are 3 "internal" streams for each keyval pair
|
|
23289
|
-
// so it basically checks if there is any value added to the form
|
|
23290
|
-
if (this._streams.length) {
|
|
23291
|
-
knownLength += this._lastBoundary().length;
|
|
23292
|
-
}
|
|
23293
|
-
|
|
23294
|
-
// https://github.com/form-data/form-data/issues/40
|
|
23295
|
-
if (!this.hasKnownLength()) {
|
|
23296
|
-
// Some async length retrievers are present
|
|
23297
|
-
// therefore synchronous length calculation is false.
|
|
23298
|
-
// Please use getLength(callback) to get proper length
|
|
23299
|
-
this._error(new Error('Cannot calculate proper length in synchronous way.'));
|
|
23300
|
-
}
|
|
23301
|
-
|
|
23302
|
-
return knownLength;
|
|
23303
|
-
};
|
|
23304
|
-
|
|
23305
|
-
// Public API to check if length of added values is known
|
|
23306
|
-
// https://github.com/form-data/form-data/issues/196
|
|
23307
|
-
// https://github.com/form-data/form-data/issues/262
|
|
23308
|
-
FormData.prototype.hasKnownLength = function() {
|
|
23309
|
-
var hasKnownLength = true;
|
|
23310
|
-
|
|
23311
|
-
if (this._valuesToMeasure.length) {
|
|
23312
|
-
hasKnownLength = false;
|
|
23313
|
-
}
|
|
23314
|
-
|
|
23315
|
-
return hasKnownLength;
|
|
23316
|
-
};
|
|
23317
|
-
|
|
23318
|
-
FormData.prototype.getLength = function(cb) {
|
|
23319
|
-
var knownLength = this._overheadLength + this._valueLength;
|
|
23320
|
-
|
|
23321
|
-
if (this._streams.length) {
|
|
23322
|
-
knownLength += this._lastBoundary().length;
|
|
23323
|
-
}
|
|
23324
|
-
|
|
23325
|
-
if (!this._valuesToMeasure.length) {
|
|
23326
|
-
process.nextTick(cb.bind(this, null, knownLength));
|
|
23327
|
-
return;
|
|
23328
|
-
}
|
|
23329
|
-
|
|
23330
|
-
asynckit.parallel(this._valuesToMeasure, this._lengthRetriever, function(err, values) {
|
|
23331
|
-
if (err) {
|
|
23332
|
-
cb(err);
|
|
23333
|
-
return;
|
|
23334
|
-
}
|
|
23335
|
-
|
|
23336
|
-
values.forEach(function(length) {
|
|
23337
|
-
knownLength += length;
|
|
23338
|
-
});
|
|
23339
|
-
|
|
23340
|
-
cb(null, knownLength);
|
|
23341
|
-
});
|
|
23342
|
-
};
|
|
23343
|
-
|
|
23344
|
-
FormData.prototype.submit = function(params, cb) {
|
|
23345
|
-
var request
|
|
23346
|
-
, options
|
|
23347
|
-
, defaults = {method: 'post'}
|
|
23348
|
-
;
|
|
23349
|
-
|
|
23350
|
-
// parse provided url if it's string
|
|
23351
|
-
// or treat it as options object
|
|
23352
|
-
if (typeof params == 'string') {
|
|
23353
|
-
|
|
23354
|
-
params = parseUrl(params);
|
|
23355
|
-
options = populate({
|
|
23356
|
-
port: params.port,
|
|
23357
|
-
path: params.pathname,
|
|
23358
|
-
host: params.hostname,
|
|
23359
|
-
protocol: params.protocol
|
|
23360
|
-
}, defaults);
|
|
23361
|
-
|
|
23362
|
-
// use custom params
|
|
23363
|
-
} else {
|
|
23364
|
-
|
|
23365
|
-
options = populate(params, defaults);
|
|
23366
|
-
// if no port provided use default one
|
|
23367
|
-
if (!options.port) {
|
|
23368
|
-
options.port = options.protocol == 'https:' ? 443 : 80;
|
|
23369
|
-
}
|
|
23370
|
-
}
|
|
23371
|
-
|
|
23372
|
-
// put that good code in getHeaders to some use
|
|
23373
|
-
options.headers = this.getHeaders(params.headers);
|
|
23374
|
-
|
|
23375
|
-
// https if specified, fallback to http in any other case
|
|
23376
|
-
if (options.protocol == 'https:') {
|
|
23377
|
-
request = https.request(options);
|
|
23378
|
-
} else {
|
|
23379
|
-
request = http.request(options);
|
|
23380
|
-
}
|
|
23381
|
-
|
|
23382
|
-
// get content length and fire away
|
|
23383
|
-
this.getLength(function(err, length) {
|
|
23384
|
-
if (err) {
|
|
23385
|
-
this._error(err);
|
|
23386
|
-
return;
|
|
23387
|
-
}
|
|
23388
|
-
|
|
23389
|
-
// add content length
|
|
23390
|
-
request.setHeader('Content-Length', length);
|
|
23391
|
-
|
|
23392
|
-
this.pipe(request);
|
|
23393
|
-
if (cb) {
|
|
23394
|
-
request.on('error', cb);
|
|
23395
|
-
request.on('response', cb.bind(this, null));
|
|
23396
|
-
}
|
|
23397
|
-
}.bind(this));
|
|
23398
|
-
|
|
23399
|
-
return request;
|
|
23400
|
-
};
|
|
23401
|
-
|
|
23402
|
-
FormData.prototype._error = function(err) {
|
|
23403
|
-
if (!this.error) {
|
|
23404
|
-
this.error = err;
|
|
23405
|
-
this.pause();
|
|
23406
|
-
this.emit('error', err);
|
|
23407
|
-
}
|
|
23408
|
-
};
|
|
23409
|
-
|
|
23410
|
-
FormData.prototype.toString = function () {
|
|
23411
|
-
return '[object FormData]';
|
|
23412
|
-
};
|
|
23413
|
-
|
|
23414
|
-
|
|
23415
|
-
/***/ }),
|
|
23416
|
-
|
|
23417
|
-
/***/ 10453:
|
|
23418
|
-
/***/ ((module) => {
|
|
23419
|
-
|
|
23420
|
-
// populates missing values
|
|
23421
|
-
module.exports = function(dst, src) {
|
|
23422
|
-
|
|
23423
|
-
Object.keys(src).forEach(function(prop)
|
|
23424
|
-
{
|
|
23425
|
-
dst[prop] = dst[prop] || src[prop];
|
|
23426
|
-
});
|
|
23427
|
-
|
|
23428
|
-
return dst;
|
|
23429
|
-
};
|
|
23430
|
-
|
|
23431
|
-
|
|
23432
|
-
/***/ }),
|
|
23433
|
-
|
|
23434
|
-
/***/ 74608:
|
|
23435
|
-
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
23436
|
-
|
|
23437
|
-
"use strict";
|
|
23438
|
-
|
|
23439
|
-
var spin = __webpack_require__(74365)
|
|
23440
|
-
var progressBar = __webpack_require__(8936)
|
|
23441
|
-
|
|
23442
|
-
module.exports = {
|
|
23443
|
-
activityIndicator: function (values, theme, width) {
|
|
23444
|
-
if (values.spun == null) return
|
|
23445
|
-
return spin(theme, values.spun)
|
|
23446
|
-
},
|
|
23447
|
-
progressbar: function (values, theme, width) {
|
|
23448
|
-
if (values.completed == null) return
|
|
23449
|
-
return progressBar(theme, width, values.completed)
|
|
23450
|
-
}
|
|
23451
|
-
}
|
|
23452
|
-
|
|
23453
|
-
|
|
23454
|
-
/***/ }),
|
|
23455
|
-
|
|
23456
|
-
/***/ 15591:
|
|
23457
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
23458
|
-
|
|
23459
|
-
"use strict";
|
|
23460
|
-
|
|
23461
|
-
var util = __webpack_require__(31669)
|
|
23462
|
-
|
|
23463
|
-
var User = exports.User = function User (msg) {
|
|
23464
|
-
var err = new Error(msg)
|
|
23465
|
-
Error.captureStackTrace(err, User)
|
|
23466
|
-
err.code = 'EGAUGE'
|
|
23467
|
-
return err
|
|
23468
|
-
}
|
|
23469
|
-
|
|
23470
|
-
exports.MissingTemplateValue = function MissingTemplateValue (item, values) {
|
|
23471
|
-
var err = new User(util.format('Missing template value "%s"', item.type))
|
|
23472
|
-
Error.captureStackTrace(err, MissingTemplateValue)
|
|
23473
|
-
err.template = item
|
|
23474
|
-
err.values = values
|
|
23475
|
-
return err
|
|
23476
|
-
}
|
|
23477
|
-
|
|
23478
|
-
exports.Internal = function Internal (msg) {
|
|
23479
|
-
var err = new Error(msg)
|
|
23480
|
-
Error.captureStackTrace(err, Internal)
|
|
23481
|
-
err.code = 'EGAUGEINTERNAL'
|
|
23482
|
-
return err
|
|
23483
|
-
}
|
|
23484
|
-
|
|
23485
|
-
|
|
23486
|
-
/***/ }),
|
|
23487
|
-
|
|
23488
|
-
/***/ 18029:
|
|
23489
|
-
/***/ ((module) => {
|
|
23490
|
-
|
|
23491
|
-
"use strict";
|
|
23492
|
-
|
|
23493
|
-
|
|
23494
|
-
module.exports = isWin32() || isColorTerm()
|
|
23495
|
-
|
|
23496
|
-
function isWin32 () {
|
|
23497
|
-
return process.platform === 'win32'
|
|
23498
|
-
}
|
|
23499
|
-
|
|
23500
|
-
function isColorTerm () {
|
|
23501
|
-
var termHasColor = /^screen|^xterm|^vt100|color|ansi|cygwin|linux/i
|
|
23502
|
-
return !!process.env.COLORTERM || termHasColor.test(process.env.TERM)
|
|
23503
|
-
}
|
|
23504
|
-
|
|
23505
|
-
|
|
23506
|
-
/***/ }),
|
|
23507
|
-
|
|
23508
|
-
/***/ 1757:
|
|
23509
|
-
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
23510
|
-
|
|
23511
|
-
"use strict";
|
|
23512
|
-
|
|
23513
|
-
var Plumbing = __webpack_require__(17852)
|
|
23514
|
-
var hasUnicode = __webpack_require__(29253)
|
|
23515
|
-
var hasColor = __webpack_require__(18029)
|
|
23516
|
-
var onExit = __webpack_require__(40412)
|
|
23517
|
-
var defaultThemes = __webpack_require__(62834)
|
|
23518
|
-
var setInterval = __webpack_require__(29165)
|
|
23519
|
-
var process = __webpack_require__(22156)
|
|
23520
|
-
var setImmediate = __webpack_require__(48761)
|
|
23521
|
-
|
|
23522
|
-
module.exports = Gauge
|
|
23523
|
-
|
|
23524
|
-
function callWith (obj, method) {
|
|
23525
|
-
return function () {
|
|
23526
|
-
return method.call(obj)
|
|
23527
|
-
}
|
|
23528
|
-
}
|
|
23529
|
-
|
|
23530
|
-
function Gauge (arg1, arg2) {
|
|
23531
|
-
var options, writeTo
|
|
23532
|
-
if (arg1 && arg1.write) {
|
|
23533
|
-
writeTo = arg1
|
|
23534
|
-
options = arg2 || {}
|
|
23535
|
-
} else if (arg2 && arg2.write) {
|
|
23536
|
-
writeTo = arg2
|
|
23537
|
-
options = arg1 || {}
|
|
23538
|
-
} else {
|
|
23539
|
-
writeTo = process.stderr
|
|
23540
|
-
options = arg1 || arg2 || {}
|
|
23541
|
-
}
|
|
23542
|
-
|
|
23543
|
-
this._status = {
|
|
23544
|
-
spun: 0,
|
|
23545
|
-
section: '',
|
|
23546
|
-
subsection: ''
|
|
23547
|
-
}
|
|
23548
|
-
this._paused = false // are we paused for back pressure?
|
|
23549
|
-
this._disabled = true // are all progress bar updates disabled?
|
|
23550
|
-
this._showing = false // do we WANT the progress bar on screen
|
|
23551
|
-
this._onScreen = false // IS the progress bar on screen
|
|
23552
|
-
this._needsRedraw = false // should we print something at next tick?
|
|
23553
|
-
this._hideCursor = options.hideCursor == null ? true : options.hideCursor
|
|
23554
|
-
this._fixedFramerate = options.fixedFramerate == null
|
|
23555
|
-
? !(/^v0\.8\./.test(process.version))
|
|
23556
|
-
: options.fixedFramerate
|
|
23557
|
-
this._lastUpdateAt = null
|
|
23558
|
-
this._updateInterval = options.updateInterval == null ? 50 : options.updateInterval
|
|
23559
|
-
|
|
23560
|
-
this._themes = options.themes || defaultThemes
|
|
23561
|
-
this._theme = options.theme
|
|
23562
|
-
var theme = this._computeTheme(options.theme)
|
|
23563
|
-
var template = options.template || [
|
|
23564
|
-
{type: 'progressbar', length: 20},
|
|
23565
|
-
{type: 'activityIndicator', kerning: 1, length: 1},
|
|
23566
|
-
{type: 'section', kerning: 1, default: ''},
|
|
23567
|
-
{type: 'subsection', kerning: 1, default: ''}
|
|
23568
|
-
]
|
|
23569
|
-
this.setWriteTo(writeTo, options.tty)
|
|
23570
|
-
var PlumbingClass = options.Plumbing || Plumbing
|
|
23571
|
-
this._gauge = new PlumbingClass(theme, template, this.getWidth())
|
|
23572
|
-
|
|
23573
|
-
this._$$doRedraw = callWith(this, this._doRedraw)
|
|
23574
|
-
this._$$handleSizeChange = callWith(this, this._handleSizeChange)
|
|
23092
|
+
this._$$doRedraw = callWith(this, this._doRedraw)
|
|
23093
|
+
this._$$handleSizeChange = callWith(this, this._handleSizeChange)
|
|
23575
23094
|
|
|
23576
23095
|
this._cleanupOnExit = options.cleanupOnExit == null || options.cleanupOnExit
|
|
23577
23096
|
this._removeOnExit = null
|
|
@@ -29830,9 +29349,7 @@ function escapeJsonPtr(str) {
|
|
|
29830
29349
|
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/**
|
|
29831
29350
|
* JSONSchema Validator - Validates JavaScript objects using JSON Schemas
|
|
29832
29351
|
* (http://www.json.com/json-schema-proposal/)
|
|
29833
|
-
*
|
|
29834
|
-
* Copyright (c) 2007 Kris Zyp SitePen (www.sitepen.com)
|
|
29835
|
-
* Licensed under the MIT (MIT-LICENSE.txt) license.
|
|
29352
|
+
* Licensed under AFL-2.1 OR BSD-3-Clause
|
|
29836
29353
|
To use the validator call the validate function with an instance object and an optional schema object.
|
|
29837
29354
|
If a schema is provided, it will be used to validate. If the instance object refers to a schema (self-validating),
|
|
29838
29355
|
that schema will be used to validate and the schema parameter is not necessary (if both exist,
|
|
@@ -29929,7 +29446,7 @@ var validate = exports._validate = function(/*Any*/instance,/*Object*/schema,/*O
|
|
|
29929
29446
|
!(value instanceof Array && type == 'array') &&
|
|
29930
29447
|
!(value instanceof Date && type == 'date') &&
|
|
29931
29448
|
!(type == 'integer' && value%1===0)){
|
|
29932
|
-
return [{property:path,message:(typeof value) + " value found, but a " + type + " is required"}];
|
|
29449
|
+
return [{property:path,message:value + " - " + (typeof value) + " value found, but a " + type + " is required"}];
|
|
29933
29450
|
}
|
|
29934
29451
|
if(type instanceof Array){
|
|
29935
29452
|
var unionErrors=[];
|
|
@@ -29992,11 +29509,11 @@ var validate = exports._validate = function(/*Any*/instance,/*Object*/schema,/*O
|
|
|
29992
29509
|
if(schema.minLength && typeof value == 'string' && value.length < schema.minLength){
|
|
29993
29510
|
addError("must be at least " + schema.minLength + " characters long");
|
|
29994
29511
|
}
|
|
29995
|
-
if(typeof schema.minimum !== undefined && typeof value == typeof schema.minimum &&
|
|
29512
|
+
if(typeof schema.minimum !== 'undefined' && typeof value == typeof schema.minimum &&
|
|
29996
29513
|
schema.minimum > value){
|
|
29997
29514
|
addError("must have a minimum value of " + schema.minimum);
|
|
29998
29515
|
}
|
|
29999
|
-
if(typeof schema.maximum !== undefined && typeof value == typeof schema.maximum &&
|
|
29516
|
+
if(typeof schema.maximum !== 'undefined' && typeof value == typeof schema.maximum &&
|
|
30000
29517
|
schema.maximum < value){
|
|
30001
29518
|
addError("must have a maximum value of " + schema.maximum);
|
|
30002
29519
|
}
|
|
@@ -30031,8 +29548,8 @@ var validate = exports._validate = function(/*Any*/instance,/*Object*/schema,/*O
|
|
|
30031
29548
|
}
|
|
30032
29549
|
|
|
30033
29550
|
for(var i in objTypeDef){
|
|
30034
|
-
if(objTypeDef.hasOwnProperty(i)){
|
|
30035
|
-
var value = instance[i];
|
|
29551
|
+
if(objTypeDef.hasOwnProperty(i) && i != '__proto__' && i != 'constructor'){
|
|
29552
|
+
var value = instance.hasOwnProperty(i) ? instance[i] : undefined;
|
|
30036
29553
|
// skip _not_ specified properties
|
|
30037
29554
|
if (value === undefined && options.existingOnly) continue;
|
|
30038
29555
|
var propDef = objTypeDef[i];
|
|
@@ -30053,7 +29570,7 @@ var validate = exports._validate = function(/*Any*/instance,/*Object*/schema,/*O
|
|
|
30053
29570
|
delete instance[i];
|
|
30054
29571
|
continue;
|
|
30055
29572
|
} else {
|
|
30056
|
-
errors.push({property:path,message:
|
|
29573
|
+
errors.push({property:path,message:"The property " + i +
|
|
30057
29574
|
" is not defined in the schema and the schema does not allow additional properties"});
|
|
30058
29575
|
}
|
|
30059
29576
|
}
|
|
@@ -36799,1682 +36316,2163 @@ module.exports = function (options) {
|
|
|
36799
36316
|
|
|
36800
36317
|
if (err) {
|
|
36801
36318
|
|
|
36802
|
-
self._rp_reject(new errors.RequestError(err, self._rp_options, response));
|
|
36319
|
+
self._rp_reject(new errors.RequestError(err, self._rp_options, response));
|
|
36320
|
+
|
|
36321
|
+
} else if (self._rp_options.simple && !is2xx) {
|
|
36322
|
+
|
|
36323
|
+
if (isFunction(self._rp_options.transform) && self._rp_options.transform2xxOnly === false) {
|
|
36324
|
+
|
|
36325
|
+
(new PromiseImpl(function (resolve) {
|
|
36326
|
+
resolve(self._rp_options.transform(body, response, self._rp_options.resolveWithFullResponse)); // transform may return a Promise
|
|
36327
|
+
}))
|
|
36328
|
+
.then(function (transformedResponse) {
|
|
36329
|
+
self._rp_reject(new errors.StatusCodeError(response.statusCode, body, self._rp_options, transformedResponse));
|
|
36330
|
+
})
|
|
36331
|
+
.catch(function (transformErr) {
|
|
36332
|
+
self._rp_reject(new errors.TransformError(transformErr, self._rp_options, response));
|
|
36333
|
+
});
|
|
36334
|
+
|
|
36335
|
+
} else {
|
|
36336
|
+
self._rp_reject(new errors.StatusCodeError(response.statusCode, body, self._rp_options, response));
|
|
36337
|
+
}
|
|
36338
|
+
|
|
36339
|
+
} else {
|
|
36340
|
+
|
|
36341
|
+
if (isFunction(self._rp_options.transform) && (is2xx || self._rp_options.transform2xxOnly === false)) {
|
|
36342
|
+
|
|
36343
|
+
(new PromiseImpl(function (resolve) {
|
|
36344
|
+
resolve(self._rp_options.transform(body, response, self._rp_options.resolveWithFullResponse)); // transform may return a Promise
|
|
36345
|
+
}))
|
|
36346
|
+
.then(function (transformedResponse) {
|
|
36347
|
+
self._rp_resolve(transformedResponse);
|
|
36348
|
+
})
|
|
36349
|
+
.catch(function (transformErr) {
|
|
36350
|
+
self._rp_reject(new errors.TransformError(transformErr, self._rp_options, response));
|
|
36351
|
+
});
|
|
36352
|
+
|
|
36353
|
+
} else if (self._rp_options.resolveWithFullResponse) {
|
|
36354
|
+
self._rp_resolve(response);
|
|
36355
|
+
} else {
|
|
36356
|
+
self._rp_resolve(body);
|
|
36357
|
+
}
|
|
36358
|
+
|
|
36359
|
+
}
|
|
36360
|
+
|
|
36361
|
+
if (origCallbackThrewException) {
|
|
36362
|
+
throw thrownException;
|
|
36363
|
+
}
|
|
36364
|
+
|
|
36365
|
+
};
|
|
36366
|
+
|
|
36367
|
+
plumbing.exposePromiseMethod = function (exposeTo, bindTo, promisePropertyKey, methodToExpose, exposeAs) {
|
|
36368
|
+
|
|
36369
|
+
exposeAs = exposeAs || methodToExpose;
|
|
36370
|
+
|
|
36371
|
+
if (exposeAs in exposeTo) {
|
|
36372
|
+
throw new Error('Unable to expose method "' + exposeAs + '"');
|
|
36373
|
+
}
|
|
36374
|
+
|
|
36375
|
+
exposeTo[exposeAs] = function RP$exposed() {
|
|
36376
|
+
var self = bindTo || this;
|
|
36377
|
+
return self[promisePropertyKey][methodToExpose].apply(self[promisePropertyKey], arguments);
|
|
36378
|
+
};
|
|
36379
|
+
|
|
36380
|
+
};
|
|
36381
|
+
|
|
36382
|
+
plumbing.exposePromise = function (exposeTo, bindTo, promisePropertyKey, exposeAs) {
|
|
36383
|
+
|
|
36384
|
+
exposeAs = exposeAs || 'promise';
|
|
36385
|
+
|
|
36386
|
+
if (exposeAs in exposeTo) {
|
|
36387
|
+
throw new Error('Unable to expose method "' + exposeAs + '"');
|
|
36388
|
+
}
|
|
36389
|
+
|
|
36390
|
+
exposeTo[exposeAs] = function RP$promise() {
|
|
36391
|
+
var self = bindTo || this;
|
|
36392
|
+
return self[promisePropertyKey];
|
|
36393
|
+
};
|
|
36394
|
+
|
|
36395
|
+
};
|
|
36396
|
+
|
|
36397
|
+
return plumbing;
|
|
36398
|
+
|
|
36399
|
+
};
|
|
36400
|
+
|
|
36401
|
+
|
|
36402
|
+
/***/ }),
|
|
36403
|
+
|
|
36404
|
+
/***/ 19602:
|
|
36405
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
36406
|
+
|
|
36407
|
+
"use strict";
|
|
36408
|
+
/* module decorator */ module = __webpack_require__.nmd(module);
|
|
36409
|
+
|
|
36410
|
+
|
|
36411
|
+
var Bluebird = __webpack_require__(56102).getNewLibraryCopy(),
|
|
36412
|
+
configure = __webpack_require__(49531),
|
|
36413
|
+
stealthyRequire = __webpack_require__(81303);
|
|
36414
|
+
|
|
36415
|
+
try {
|
|
36416
|
+
|
|
36417
|
+
// Load Request freshly - so that users can require an unaltered request instance!
|
|
36418
|
+
var request = stealthyRequire(__webpack_require__.c, function () {
|
|
36419
|
+
return __webpack_require__(27761);
|
|
36420
|
+
},
|
|
36421
|
+
function () {
|
|
36422
|
+
__webpack_require__(98913);
|
|
36423
|
+
}, module);
|
|
36424
|
+
|
|
36425
|
+
} catch (err) {
|
|
36426
|
+
/* istanbul ignore next */
|
|
36427
|
+
var EOL = __webpack_require__(12087).EOL;
|
|
36428
|
+
/* istanbul ignore next */
|
|
36429
|
+
console.error(EOL + '###' + EOL + '### The "request" library is not installed automatically anymore.' + EOL + '### But is a dependency of "request-promise".' + EOL + '### Please install it with:' + EOL + '### npm install request --save' + EOL + '###' + EOL);
|
|
36430
|
+
/* istanbul ignore next */
|
|
36431
|
+
throw err;
|
|
36432
|
+
}
|
|
36433
|
+
|
|
36434
|
+
Bluebird.config({cancellation: true});
|
|
36435
|
+
|
|
36436
|
+
configure({
|
|
36437
|
+
request: request,
|
|
36438
|
+
PromiseImpl: Bluebird,
|
|
36439
|
+
expose: [
|
|
36440
|
+
'then',
|
|
36441
|
+
'catch',
|
|
36442
|
+
'finally',
|
|
36443
|
+
'cancel',
|
|
36444
|
+
'promise'
|
|
36445
|
+
// Would you like to expose more Bluebird methods? Try e.g. `rp(...).promise().tap(...)` first. `.promise()` returns the full-fledged Bluebird promise.
|
|
36446
|
+
],
|
|
36447
|
+
constructorMixin: function (resolve, reject, onCancel) {
|
|
36448
|
+
var self = this;
|
|
36449
|
+
onCancel(function () {
|
|
36450
|
+
self.abort();
|
|
36451
|
+
});
|
|
36452
|
+
}
|
|
36453
|
+
});
|
|
36454
|
+
|
|
36455
|
+
request.bindCLS = function RP$bindCLS() {
|
|
36456
|
+
throw new Error('CLS support was dropped. To get it back read: https://github.com/request/request-promise/wiki/Getting-Back-Support-for-Continuation-Local-Storage');
|
|
36457
|
+
};
|
|
36458
|
+
|
|
36459
|
+
|
|
36460
|
+
module.exports = request;
|
|
36461
|
+
|
|
36462
|
+
|
|
36463
|
+
/***/ }),
|
|
36464
|
+
|
|
36465
|
+
/***/ 27761:
|
|
36466
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
36467
|
+
|
|
36468
|
+
"use strict";
|
|
36469
|
+
// Copyright 2010-2012 Mikeal Rogers
|
|
36470
|
+
//
|
|
36471
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
36472
|
+
// you may not use this file except in compliance with the License.
|
|
36473
|
+
// You may obtain a copy of the License at
|
|
36474
|
+
//
|
|
36475
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
36476
|
+
//
|
|
36477
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
36478
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
36479
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
36480
|
+
// See the License for the specific language governing permissions and
|
|
36481
|
+
// limitations under the License.
|
|
36482
|
+
|
|
36483
|
+
|
|
36484
|
+
|
|
36485
|
+
var extend = __webpack_require__(51302)
|
|
36486
|
+
var cookies = __webpack_require__(77225)
|
|
36487
|
+
var helpers = __webpack_require__(73093)
|
|
36488
|
+
|
|
36489
|
+
var paramsHaveRequestBody = helpers.paramsHaveRequestBody
|
|
36490
|
+
|
|
36491
|
+
// organize params for patch, post, put, head, del
|
|
36492
|
+
function initParams (uri, options, callback) {
|
|
36493
|
+
if (typeof options === 'function') {
|
|
36494
|
+
callback = options
|
|
36495
|
+
}
|
|
36496
|
+
|
|
36497
|
+
var params = {}
|
|
36498
|
+
if (options !== null && typeof options === 'object') {
|
|
36499
|
+
extend(params, options, {uri: uri})
|
|
36500
|
+
} else if (typeof uri === 'string') {
|
|
36501
|
+
extend(params, {uri: uri})
|
|
36502
|
+
} else {
|
|
36503
|
+
extend(params, uri)
|
|
36504
|
+
}
|
|
36505
|
+
|
|
36506
|
+
params.callback = callback || params.callback
|
|
36507
|
+
return params
|
|
36508
|
+
}
|
|
36509
|
+
|
|
36510
|
+
function request (uri, options, callback) {
|
|
36511
|
+
if (typeof uri === 'undefined') {
|
|
36512
|
+
throw new Error('undefined is not a valid uri or options object.')
|
|
36513
|
+
}
|
|
36514
|
+
|
|
36515
|
+
var params = initParams(uri, options, callback)
|
|
36516
|
+
|
|
36517
|
+
if (params.method === 'HEAD' && paramsHaveRequestBody(params)) {
|
|
36518
|
+
throw new Error('HTTP HEAD requests MUST NOT include a request body.')
|
|
36519
|
+
}
|
|
36520
|
+
|
|
36521
|
+
return new request.Request(params)
|
|
36522
|
+
}
|
|
36523
|
+
|
|
36524
|
+
function verbFunc (verb) {
|
|
36525
|
+
var method = verb.toUpperCase()
|
|
36526
|
+
return function (uri, options, callback) {
|
|
36527
|
+
var params = initParams(uri, options, callback)
|
|
36528
|
+
params.method = method
|
|
36529
|
+
return request(params, params.callback)
|
|
36530
|
+
}
|
|
36531
|
+
}
|
|
36532
|
+
|
|
36533
|
+
// define like this to please codeintel/intellisense IDEs
|
|
36534
|
+
request.get = verbFunc('get')
|
|
36535
|
+
request.head = verbFunc('head')
|
|
36536
|
+
request.options = verbFunc('options')
|
|
36537
|
+
request.post = verbFunc('post')
|
|
36538
|
+
request.put = verbFunc('put')
|
|
36539
|
+
request.patch = verbFunc('patch')
|
|
36540
|
+
request.del = verbFunc('delete')
|
|
36541
|
+
request['delete'] = verbFunc('delete')
|
|
36542
|
+
|
|
36543
|
+
request.jar = function (store) {
|
|
36544
|
+
return cookies.jar(store)
|
|
36545
|
+
}
|
|
36546
|
+
|
|
36547
|
+
request.cookie = function (str) {
|
|
36548
|
+
return cookies.parse(str)
|
|
36549
|
+
}
|
|
36550
|
+
|
|
36551
|
+
function wrapRequestMethod (method, options, requester, verb) {
|
|
36552
|
+
return function (uri, opts, callback) {
|
|
36553
|
+
var params = initParams(uri, opts, callback)
|
|
36554
|
+
|
|
36555
|
+
var target = {}
|
|
36556
|
+
extend(true, target, options, params)
|
|
36557
|
+
|
|
36558
|
+
target.pool = params.pool || options.pool
|
|
36803
36559
|
|
|
36804
|
-
|
|
36560
|
+
if (verb) {
|
|
36561
|
+
target.method = verb.toUpperCase()
|
|
36562
|
+
}
|
|
36805
36563
|
|
|
36806
|
-
|
|
36564
|
+
if (typeof requester === 'function') {
|
|
36565
|
+
method = requester
|
|
36566
|
+
}
|
|
36807
36567
|
|
|
36808
|
-
|
|
36809
|
-
|
|
36810
|
-
|
|
36811
|
-
.then(function (transformedResponse) {
|
|
36812
|
-
self._rp_reject(new errors.StatusCodeError(response.statusCode, body, self._rp_options, transformedResponse));
|
|
36813
|
-
})
|
|
36814
|
-
.catch(function (transformErr) {
|
|
36815
|
-
self._rp_reject(new errors.TransformError(transformErr, self._rp_options, response));
|
|
36816
|
-
});
|
|
36568
|
+
return method(target, target.callback)
|
|
36569
|
+
}
|
|
36570
|
+
}
|
|
36817
36571
|
|
|
36818
|
-
|
|
36819
|
-
|
|
36820
|
-
}
|
|
36572
|
+
request.defaults = function (options, requester) {
|
|
36573
|
+
var self = this
|
|
36821
36574
|
|
|
36822
|
-
|
|
36575
|
+
options = options || {}
|
|
36823
36576
|
|
|
36824
|
-
|
|
36577
|
+
if (typeof options === 'function') {
|
|
36578
|
+
requester = options
|
|
36579
|
+
options = {}
|
|
36580
|
+
}
|
|
36825
36581
|
|
|
36826
|
-
|
|
36827
|
-
resolve(self._rp_options.transform(body, response, self._rp_options.resolveWithFullResponse)); // transform may return a Promise
|
|
36828
|
-
}))
|
|
36829
|
-
.then(function (transformedResponse) {
|
|
36830
|
-
self._rp_resolve(transformedResponse);
|
|
36831
|
-
})
|
|
36832
|
-
.catch(function (transformErr) {
|
|
36833
|
-
self._rp_reject(new errors.TransformError(transformErr, self._rp_options, response));
|
|
36834
|
-
});
|
|
36582
|
+
var defaults = wrapRequestMethod(self, options, requester)
|
|
36835
36583
|
|
|
36836
|
-
|
|
36837
|
-
|
|
36838
|
-
|
|
36839
|
-
|
|
36840
|
-
}
|
|
36584
|
+
var verbs = ['get', 'head', 'post', 'put', 'patch', 'del', 'delete']
|
|
36585
|
+
verbs.forEach(function (verb) {
|
|
36586
|
+
defaults[verb] = wrapRequestMethod(self[verb], options, requester, verb)
|
|
36587
|
+
})
|
|
36841
36588
|
|
|
36842
|
-
|
|
36589
|
+
defaults.cookie = wrapRequestMethod(self.cookie, options, requester)
|
|
36590
|
+
defaults.jar = self.jar
|
|
36591
|
+
defaults.defaults = self.defaults
|
|
36592
|
+
return defaults
|
|
36593
|
+
}
|
|
36843
36594
|
|
|
36844
|
-
|
|
36845
|
-
|
|
36846
|
-
|
|
36595
|
+
request.forever = function (agentOptions, optionsArg) {
|
|
36596
|
+
var options = {}
|
|
36597
|
+
if (optionsArg) {
|
|
36598
|
+
extend(options, optionsArg)
|
|
36599
|
+
}
|
|
36600
|
+
if (agentOptions) {
|
|
36601
|
+
options.agentOptions = agentOptions
|
|
36602
|
+
}
|
|
36847
36603
|
|
|
36848
|
-
|
|
36604
|
+
options.forever = true
|
|
36605
|
+
return request.defaults(options)
|
|
36606
|
+
}
|
|
36849
36607
|
|
|
36850
|
-
|
|
36608
|
+
// Exports
|
|
36851
36609
|
|
|
36852
|
-
|
|
36610
|
+
module.exports = request
|
|
36611
|
+
request.Request = __webpack_require__(80946)
|
|
36612
|
+
request.initParams = initParams
|
|
36853
36613
|
|
|
36854
|
-
|
|
36855
|
-
|
|
36856
|
-
|
|
36614
|
+
// Backwards compatibility for request.debug
|
|
36615
|
+
Object.defineProperty(request, 'debug', {
|
|
36616
|
+
enumerable: true,
|
|
36617
|
+
get: function () {
|
|
36618
|
+
return request.Request.debug
|
|
36619
|
+
},
|
|
36620
|
+
set: function (debug) {
|
|
36621
|
+
request.Request.debug = debug
|
|
36622
|
+
}
|
|
36623
|
+
})
|
|
36857
36624
|
|
|
36858
|
-
exposeTo[exposeAs] = function RP$exposed() {
|
|
36859
|
-
var self = bindTo || this;
|
|
36860
|
-
return self[promisePropertyKey][methodToExpose].apply(self[promisePropertyKey], arguments);
|
|
36861
|
-
};
|
|
36862
36625
|
|
|
36863
|
-
|
|
36626
|
+
/***/ }),
|
|
36864
36627
|
|
|
36865
|
-
|
|
36628
|
+
/***/ 13350:
|
|
36629
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
36866
36630
|
|
|
36867
|
-
|
|
36631
|
+
"use strict";
|
|
36868
36632
|
|
|
36869
|
-
if (exposeAs in exposeTo) {
|
|
36870
|
-
throw new Error('Unable to expose method "' + exposeAs + '"');
|
|
36871
|
-
}
|
|
36872
36633
|
|
|
36873
|
-
|
|
36874
|
-
|
|
36875
|
-
|
|
36876
|
-
};
|
|
36634
|
+
var caseless = __webpack_require__(72464)
|
|
36635
|
+
var uuid = __webpack_require__(69355)
|
|
36636
|
+
var helpers = __webpack_require__(73093)
|
|
36877
36637
|
|
|
36878
|
-
|
|
36638
|
+
var md5 = helpers.md5
|
|
36639
|
+
var toBase64 = helpers.toBase64
|
|
36879
36640
|
|
|
36880
|
-
|
|
36641
|
+
function Auth (request) {
|
|
36642
|
+
// define all public properties here
|
|
36643
|
+
this.request = request
|
|
36644
|
+
this.hasAuth = false
|
|
36645
|
+
this.sentAuth = false
|
|
36646
|
+
this.bearerToken = null
|
|
36647
|
+
this.user = null
|
|
36648
|
+
this.pass = null
|
|
36649
|
+
}
|
|
36881
36650
|
|
|
36882
|
-
|
|
36651
|
+
Auth.prototype.basic = function (user, pass, sendImmediately) {
|
|
36652
|
+
var self = this
|
|
36653
|
+
if (typeof user !== 'string' || (pass !== undefined && typeof pass !== 'string')) {
|
|
36654
|
+
self.request.emit('error', new Error('auth() received invalid user or password'))
|
|
36655
|
+
}
|
|
36656
|
+
self.user = user
|
|
36657
|
+
self.pass = pass
|
|
36658
|
+
self.hasAuth = true
|
|
36659
|
+
var header = user + ':' + (pass || '')
|
|
36660
|
+
if (sendImmediately || typeof sendImmediately === 'undefined') {
|
|
36661
|
+
var authHeader = 'Basic ' + toBase64(header)
|
|
36662
|
+
self.sentAuth = true
|
|
36663
|
+
return authHeader
|
|
36664
|
+
}
|
|
36665
|
+
}
|
|
36883
36666
|
|
|
36667
|
+
Auth.prototype.bearer = function (bearer, sendImmediately) {
|
|
36668
|
+
var self = this
|
|
36669
|
+
self.bearerToken = bearer
|
|
36670
|
+
self.hasAuth = true
|
|
36671
|
+
if (sendImmediately || typeof sendImmediately === 'undefined') {
|
|
36672
|
+
if (typeof bearer === 'function') {
|
|
36673
|
+
bearer = bearer()
|
|
36674
|
+
}
|
|
36675
|
+
var authHeader = 'Bearer ' + (bearer || '')
|
|
36676
|
+
self.sentAuth = true
|
|
36677
|
+
return authHeader
|
|
36678
|
+
}
|
|
36679
|
+
}
|
|
36884
36680
|
|
|
36885
|
-
|
|
36681
|
+
Auth.prototype.digest = function (method, path, authHeader) {
|
|
36682
|
+
// TODO: More complete implementation of RFC 2617.
|
|
36683
|
+
// - handle challenge.domain
|
|
36684
|
+
// - support qop="auth-int" only
|
|
36685
|
+
// - handle Authentication-Info (not necessarily?)
|
|
36686
|
+
// - check challenge.stale (not necessarily?)
|
|
36687
|
+
// - increase nc (not necessarily?)
|
|
36688
|
+
// For reference:
|
|
36689
|
+
// http://tools.ietf.org/html/rfc2617#section-3
|
|
36690
|
+
// https://github.com/bagder/curl/blob/master/lib/http_digest.c
|
|
36886
36691
|
|
|
36887
|
-
|
|
36888
|
-
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
36692
|
+
var self = this
|
|
36889
36693
|
|
|
36890
|
-
|
|
36891
|
-
|
|
36694
|
+
var challenge = {}
|
|
36695
|
+
var re = /([a-z0-9_-]+)=(?:"([^"]+)"|([a-z0-9_-]+))/gi
|
|
36696
|
+
while (true) {
|
|
36697
|
+
var match = re.exec(authHeader)
|
|
36698
|
+
if (!match) {
|
|
36699
|
+
break
|
|
36700
|
+
}
|
|
36701
|
+
challenge[match[1]] = match[2] || match[3]
|
|
36702
|
+
}
|
|
36892
36703
|
|
|
36704
|
+
/**
|
|
36705
|
+
* RFC 2617: handle both MD5 and MD5-sess algorithms.
|
|
36706
|
+
*
|
|
36707
|
+
* If the algorithm directive's value is "MD5" or unspecified, then HA1 is
|
|
36708
|
+
* HA1=MD5(username:realm:password)
|
|
36709
|
+
* If the algorithm directive's value is "MD5-sess", then HA1 is
|
|
36710
|
+
* HA1=MD5(MD5(username:realm:password):nonce:cnonce)
|
|
36711
|
+
*/
|
|
36712
|
+
var ha1Compute = function (algorithm, user, realm, pass, nonce, cnonce) {
|
|
36713
|
+
var ha1 = md5(user + ':' + realm + ':' + pass)
|
|
36714
|
+
if (algorithm && algorithm.toLowerCase() === 'md5-sess') {
|
|
36715
|
+
return md5(ha1 + ':' + nonce + ':' + cnonce)
|
|
36716
|
+
} else {
|
|
36717
|
+
return ha1
|
|
36718
|
+
}
|
|
36719
|
+
}
|
|
36893
36720
|
|
|
36894
|
-
var
|
|
36895
|
-
|
|
36896
|
-
|
|
36721
|
+
var qop = /(^|,)\s*auth\s*($|,)/.test(challenge.qop) && 'auth'
|
|
36722
|
+
var nc = qop && '00000001'
|
|
36723
|
+
var cnonce = qop && uuid().replace(/-/g, '')
|
|
36724
|
+
var ha1 = ha1Compute(challenge.algorithm, self.user, challenge.realm, self.pass, challenge.nonce, cnonce)
|
|
36725
|
+
var ha2 = md5(method + ':' + path)
|
|
36726
|
+
var digestResponse = qop
|
|
36727
|
+
? md5(ha1 + ':' + challenge.nonce + ':' + nc + ':' + cnonce + ':' + qop + ':' + ha2)
|
|
36728
|
+
: md5(ha1 + ':' + challenge.nonce + ':' + ha2)
|
|
36729
|
+
var authValues = {
|
|
36730
|
+
username: self.user,
|
|
36731
|
+
realm: challenge.realm,
|
|
36732
|
+
nonce: challenge.nonce,
|
|
36733
|
+
uri: path,
|
|
36734
|
+
qop: qop,
|
|
36735
|
+
response: digestResponse,
|
|
36736
|
+
nc: nc,
|
|
36737
|
+
cnonce: cnonce,
|
|
36738
|
+
algorithm: challenge.algorithm,
|
|
36739
|
+
opaque: challenge.opaque
|
|
36740
|
+
}
|
|
36897
36741
|
|
|
36898
|
-
|
|
36742
|
+
authHeader = []
|
|
36743
|
+
for (var k in authValues) {
|
|
36744
|
+
if (authValues[k]) {
|
|
36745
|
+
if (k === 'qop' || k === 'nc' || k === 'algorithm') {
|
|
36746
|
+
authHeader.push(k + '=' + authValues[k])
|
|
36747
|
+
} else {
|
|
36748
|
+
authHeader.push(k + '="' + authValues[k] + '"')
|
|
36749
|
+
}
|
|
36750
|
+
}
|
|
36751
|
+
}
|
|
36752
|
+
authHeader = 'Digest ' + authHeader.join(', ')
|
|
36753
|
+
self.sentAuth = true
|
|
36754
|
+
return authHeader
|
|
36755
|
+
}
|
|
36899
36756
|
|
|
36900
|
-
|
|
36901
|
-
|
|
36902
|
-
|
|
36903
|
-
},
|
|
36904
|
-
function () {
|
|
36905
|
-
__webpack_require__(98913);
|
|
36906
|
-
}, module);
|
|
36757
|
+
Auth.prototype.onRequest = function (user, pass, sendImmediately, bearer) {
|
|
36758
|
+
var self = this
|
|
36759
|
+
var request = self.request
|
|
36907
36760
|
|
|
36908
|
-
|
|
36909
|
-
|
|
36910
|
-
|
|
36911
|
-
|
|
36912
|
-
|
|
36913
|
-
|
|
36914
|
-
|
|
36761
|
+
var authHeader
|
|
36762
|
+
if (bearer === undefined && user === undefined) {
|
|
36763
|
+
self.request.emit('error', new Error('no auth mechanism defined'))
|
|
36764
|
+
} else if (bearer !== undefined) {
|
|
36765
|
+
authHeader = self.bearer(bearer, sendImmediately)
|
|
36766
|
+
} else {
|
|
36767
|
+
authHeader = self.basic(user, pass, sendImmediately)
|
|
36768
|
+
}
|
|
36769
|
+
if (authHeader) {
|
|
36770
|
+
request.setHeader('authorization', authHeader)
|
|
36771
|
+
}
|
|
36915
36772
|
}
|
|
36916
36773
|
|
|
36917
|
-
|
|
36774
|
+
Auth.prototype.onResponse = function (response) {
|
|
36775
|
+
var self = this
|
|
36776
|
+
var request = self.request
|
|
36918
36777
|
|
|
36919
|
-
|
|
36920
|
-
request: request,
|
|
36921
|
-
PromiseImpl: Bluebird,
|
|
36922
|
-
expose: [
|
|
36923
|
-
'then',
|
|
36924
|
-
'catch',
|
|
36925
|
-
'finally',
|
|
36926
|
-
'cancel',
|
|
36927
|
-
'promise'
|
|
36928
|
-
// Would you like to expose more Bluebird methods? Try e.g. `rp(...).promise().tap(...)` first. `.promise()` returns the full-fledged Bluebird promise.
|
|
36929
|
-
],
|
|
36930
|
-
constructorMixin: function (resolve, reject, onCancel) {
|
|
36931
|
-
var self = this;
|
|
36932
|
-
onCancel(function () {
|
|
36933
|
-
self.abort();
|
|
36934
|
-
});
|
|
36935
|
-
}
|
|
36936
|
-
});
|
|
36778
|
+
if (!self.hasAuth || self.sentAuth) { return null }
|
|
36937
36779
|
|
|
36938
|
-
|
|
36939
|
-
throw new Error('CLS support was dropped. To get it back read: https://github.com/request/request-promise/wiki/Getting-Back-Support-for-Continuation-Local-Storage');
|
|
36940
|
-
};
|
|
36780
|
+
var c = caseless(response.headers)
|
|
36941
36781
|
|
|
36782
|
+
var authHeader = c.get('www-authenticate')
|
|
36783
|
+
var authVerb = authHeader && authHeader.split(' ')[0].toLowerCase()
|
|
36784
|
+
request.debug('reauth', authVerb)
|
|
36942
36785
|
|
|
36943
|
-
|
|
36786
|
+
switch (authVerb) {
|
|
36787
|
+
case 'basic':
|
|
36788
|
+
return self.basic(self.user, self.pass, true)
|
|
36789
|
+
|
|
36790
|
+
case 'bearer':
|
|
36791
|
+
return self.bearer(self.bearerToken, true)
|
|
36792
|
+
|
|
36793
|
+
case 'digest':
|
|
36794
|
+
return self.digest(request.method, request.path, authHeader)
|
|
36795
|
+
}
|
|
36796
|
+
}
|
|
36797
|
+
|
|
36798
|
+
exports.g = Auth
|
|
36944
36799
|
|
|
36945
36800
|
|
|
36946
36801
|
/***/ }),
|
|
36947
36802
|
|
|
36948
|
-
/***/
|
|
36949
|
-
/***/ ((
|
|
36803
|
+
/***/ 77225:
|
|
36804
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
36950
36805
|
|
|
36951
36806
|
"use strict";
|
|
36952
|
-
// Copyright 2010-2012 Mikeal Rogers
|
|
36953
|
-
//
|
|
36954
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
36955
|
-
// you may not use this file except in compliance with the License.
|
|
36956
|
-
// You may obtain a copy of the License at
|
|
36957
|
-
//
|
|
36958
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
36959
|
-
//
|
|
36960
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
36961
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
36962
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
36963
|
-
// See the License for the specific language governing permissions and
|
|
36964
|
-
// limitations under the License.
|
|
36965
36807
|
|
|
36966
36808
|
|
|
36809
|
+
var tough = __webpack_require__(98913)
|
|
36967
36810
|
|
|
36968
|
-
var
|
|
36969
|
-
var
|
|
36970
|
-
var helpers = __webpack_require__(73093)
|
|
36971
|
-
|
|
36972
|
-
var paramsHaveRequestBody = helpers.paramsHaveRequestBody
|
|
36811
|
+
var Cookie = tough.Cookie
|
|
36812
|
+
var CookieJar = tough.CookieJar
|
|
36973
36813
|
|
|
36974
|
-
|
|
36975
|
-
|
|
36976
|
-
|
|
36977
|
-
callback = options
|
|
36814
|
+
exports.parse = function (str) {
|
|
36815
|
+
if (str && str.uri) {
|
|
36816
|
+
str = str.uri
|
|
36978
36817
|
}
|
|
36979
|
-
|
|
36980
|
-
|
|
36981
|
-
if (options !== null && typeof options === 'object') {
|
|
36982
|
-
extend(params, options, {uri: uri})
|
|
36983
|
-
} else if (typeof uri === 'string') {
|
|
36984
|
-
extend(params, {uri: uri})
|
|
36985
|
-
} else {
|
|
36986
|
-
extend(params, uri)
|
|
36818
|
+
if (typeof str !== 'string') {
|
|
36819
|
+
throw new Error('The cookie function only accepts STRING as param')
|
|
36987
36820
|
}
|
|
36821
|
+
return Cookie.parse(str, {loose: true})
|
|
36822
|
+
}
|
|
36988
36823
|
|
|
36989
|
-
|
|
36990
|
-
|
|
36824
|
+
// Adapt the sometimes-Async api of tough.CookieJar to our requirements
|
|
36825
|
+
function RequestJar (store) {
|
|
36826
|
+
var self = this
|
|
36827
|
+
self._jar = new CookieJar(store, {looseMode: true})
|
|
36828
|
+
}
|
|
36829
|
+
RequestJar.prototype.setCookie = function (cookieOrStr, uri, options) {
|
|
36830
|
+
var self = this
|
|
36831
|
+
return self._jar.setCookieSync(cookieOrStr, uri, options || {})
|
|
36832
|
+
}
|
|
36833
|
+
RequestJar.prototype.getCookieString = function (uri) {
|
|
36834
|
+
var self = this
|
|
36835
|
+
return self._jar.getCookieStringSync(uri)
|
|
36836
|
+
}
|
|
36837
|
+
RequestJar.prototype.getCookies = function (uri) {
|
|
36838
|
+
var self = this
|
|
36839
|
+
return self._jar.getCookiesSync(uri)
|
|
36991
36840
|
}
|
|
36992
36841
|
|
|
36993
|
-
function
|
|
36994
|
-
|
|
36995
|
-
|
|
36996
|
-
}
|
|
36842
|
+
exports.jar = function (store) {
|
|
36843
|
+
return new RequestJar(store)
|
|
36844
|
+
}
|
|
36997
36845
|
|
|
36998
|
-
var params = initParams(uri, options, callback)
|
|
36999
36846
|
|
|
37000
|
-
|
|
37001
|
-
throw new Error('HTTP HEAD requests MUST NOT include a request body.')
|
|
37002
|
-
}
|
|
36847
|
+
/***/ }),
|
|
37003
36848
|
|
|
37004
|
-
|
|
37005
|
-
|
|
36849
|
+
/***/ 22533:
|
|
36850
|
+
/***/ ((module) => {
|
|
37006
36851
|
|
|
37007
|
-
|
|
37008
|
-
var method = verb.toUpperCase()
|
|
37009
|
-
return function (uri, options, callback) {
|
|
37010
|
-
var params = initParams(uri, options, callback)
|
|
37011
|
-
params.method = method
|
|
37012
|
-
return request(params, params.callback)
|
|
37013
|
-
}
|
|
37014
|
-
}
|
|
36852
|
+
"use strict";
|
|
37015
36853
|
|
|
37016
|
-
// define like this to please codeintel/intellisense IDEs
|
|
37017
|
-
request.get = verbFunc('get')
|
|
37018
|
-
request.head = verbFunc('head')
|
|
37019
|
-
request.options = verbFunc('options')
|
|
37020
|
-
request.post = verbFunc('post')
|
|
37021
|
-
request.put = verbFunc('put')
|
|
37022
|
-
request.patch = verbFunc('patch')
|
|
37023
|
-
request.del = verbFunc('delete')
|
|
37024
|
-
request['delete'] = verbFunc('delete')
|
|
37025
36854
|
|
|
37026
|
-
|
|
37027
|
-
|
|
36855
|
+
function formatHostname (hostname) {
|
|
36856
|
+
// canonicalize the hostname, so that 'oogle.com' won't match 'google.com'
|
|
36857
|
+
return hostname.replace(/^\.*/, '.').toLowerCase()
|
|
37028
36858
|
}
|
|
37029
36859
|
|
|
37030
|
-
|
|
37031
|
-
|
|
37032
|
-
}
|
|
36860
|
+
function parseNoProxyZone (zone) {
|
|
36861
|
+
zone = zone.trim().toLowerCase()
|
|
37033
36862
|
|
|
37034
|
-
|
|
37035
|
-
|
|
37036
|
-
|
|
36863
|
+
var zoneParts = zone.split(':', 2)
|
|
36864
|
+
var zoneHost = formatHostname(zoneParts[0])
|
|
36865
|
+
var zonePort = zoneParts[1]
|
|
36866
|
+
var hasPort = zone.indexOf(':') > -1
|
|
37037
36867
|
|
|
37038
|
-
|
|
37039
|
-
|
|
36868
|
+
return {hostname: zoneHost, port: zonePort, hasPort: hasPort}
|
|
36869
|
+
}
|
|
37040
36870
|
|
|
37041
|
-
|
|
36871
|
+
function uriInNoProxy (uri, noProxy) {
|
|
36872
|
+
var port = uri.port || (uri.protocol === 'https:' ? '443' : '80')
|
|
36873
|
+
var hostname = formatHostname(uri.hostname)
|
|
36874
|
+
var noProxyList = noProxy.split(',')
|
|
37042
36875
|
|
|
37043
|
-
|
|
37044
|
-
|
|
37045
|
-
|
|
36876
|
+
// iterate through the noProxyList until it finds a match.
|
|
36877
|
+
return noProxyList.map(parseNoProxyZone).some(function (noProxyZone) {
|
|
36878
|
+
var isMatchedAt = hostname.indexOf(noProxyZone.hostname)
|
|
36879
|
+
var hostnameMatched = (
|
|
36880
|
+
isMatchedAt > -1 &&
|
|
36881
|
+
(isMatchedAt === hostname.length - noProxyZone.hostname.length)
|
|
36882
|
+
)
|
|
37046
36883
|
|
|
37047
|
-
if (
|
|
37048
|
-
|
|
36884
|
+
if (noProxyZone.hasPort) {
|
|
36885
|
+
return (port === noProxyZone.port) && hostnameMatched
|
|
37049
36886
|
}
|
|
37050
36887
|
|
|
37051
|
-
return
|
|
37052
|
-
}
|
|
36888
|
+
return hostnameMatched
|
|
36889
|
+
})
|
|
37053
36890
|
}
|
|
37054
36891
|
|
|
37055
|
-
|
|
37056
|
-
|
|
37057
|
-
|
|
37058
|
-
|
|
36892
|
+
function getProxyFromURI (uri) {
|
|
36893
|
+
// Decide the proper request proxy to use based on the request URI object and the
|
|
36894
|
+
// environmental variables (NO_PROXY, HTTP_PROXY, etc.)
|
|
36895
|
+
// respect NO_PROXY environment variables (see: https://lynx.invisible-island.net/lynx2.8.7/breakout/lynx_help/keystrokes/environments.html)
|
|
37059
36896
|
|
|
37060
|
-
|
|
37061
|
-
requester = options
|
|
37062
|
-
options = {}
|
|
37063
|
-
}
|
|
36897
|
+
var noProxy = process.env.NO_PROXY || process.env.no_proxy || ''
|
|
37064
36898
|
|
|
37065
|
-
|
|
36899
|
+
// if the noProxy is a wildcard then return null
|
|
37066
36900
|
|
|
37067
|
-
|
|
37068
|
-
|
|
37069
|
-
|
|
37070
|
-
})
|
|
36901
|
+
if (noProxy === '*') {
|
|
36902
|
+
return null
|
|
36903
|
+
}
|
|
37071
36904
|
|
|
37072
|
-
|
|
37073
|
-
defaults.jar = self.jar
|
|
37074
|
-
defaults.defaults = self.defaults
|
|
37075
|
-
return defaults
|
|
37076
|
-
}
|
|
36905
|
+
// if the noProxy is not empty and the uri is found return null
|
|
37077
36906
|
|
|
37078
|
-
|
|
37079
|
-
|
|
37080
|
-
if (optionsArg) {
|
|
37081
|
-
extend(options, optionsArg)
|
|
37082
|
-
}
|
|
37083
|
-
if (agentOptions) {
|
|
37084
|
-
options.agentOptions = agentOptions
|
|
36907
|
+
if (noProxy !== '' && uriInNoProxy(uri, noProxy)) {
|
|
36908
|
+
return null
|
|
37085
36909
|
}
|
|
37086
36910
|
|
|
37087
|
-
|
|
37088
|
-
return request.defaults(options)
|
|
37089
|
-
}
|
|
37090
|
-
|
|
37091
|
-
// Exports
|
|
36911
|
+
// Check for HTTP or HTTPS Proxy in environment Else default to null
|
|
37092
36912
|
|
|
37093
|
-
|
|
37094
|
-
|
|
37095
|
-
|
|
36913
|
+
if (uri.protocol === 'http:') {
|
|
36914
|
+
return process.env.HTTP_PROXY ||
|
|
36915
|
+
process.env.http_proxy || null
|
|
36916
|
+
}
|
|
37096
36917
|
|
|
37097
|
-
|
|
37098
|
-
|
|
37099
|
-
|
|
37100
|
-
|
|
37101
|
-
|
|
37102
|
-
},
|
|
37103
|
-
set: function (debug) {
|
|
37104
|
-
request.Request.debug = debug
|
|
36918
|
+
if (uri.protocol === 'https:') {
|
|
36919
|
+
return process.env.HTTPS_PROXY ||
|
|
36920
|
+
process.env.https_proxy ||
|
|
36921
|
+
process.env.HTTP_PROXY ||
|
|
36922
|
+
process.env.http_proxy || null
|
|
37105
36923
|
}
|
|
37106
|
-
|
|
36924
|
+
|
|
36925
|
+
// if none of that works, return null
|
|
36926
|
+
// (What uri protocol are you using then?)
|
|
36927
|
+
|
|
36928
|
+
return null
|
|
36929
|
+
}
|
|
36930
|
+
|
|
36931
|
+
module.exports = getProxyFromURI
|
|
37107
36932
|
|
|
37108
36933
|
|
|
37109
36934
|
/***/ }),
|
|
37110
36935
|
|
|
37111
|
-
/***/
|
|
36936
|
+
/***/ 34304:
|
|
37112
36937
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
37113
36938
|
|
|
37114
36939
|
"use strict";
|
|
37115
36940
|
|
|
37116
36941
|
|
|
37117
|
-
var
|
|
37118
|
-
var
|
|
37119
|
-
var
|
|
37120
|
-
|
|
37121
|
-
var md5 = helpers.md5
|
|
37122
|
-
var toBase64 = helpers.toBase64
|
|
36942
|
+
var fs = __webpack_require__(35747)
|
|
36943
|
+
var qs = __webpack_require__(71191)
|
|
36944
|
+
var validate = __webpack_require__(25856)
|
|
36945
|
+
var extend = __webpack_require__(51302)
|
|
37123
36946
|
|
|
37124
|
-
function
|
|
37125
|
-
// define all public properties here
|
|
36947
|
+
function Har (request) {
|
|
37126
36948
|
this.request = request
|
|
37127
|
-
this.hasAuth = false
|
|
37128
|
-
this.sentAuth = false
|
|
37129
|
-
this.bearerToken = null
|
|
37130
|
-
this.user = null
|
|
37131
|
-
this.pass = null
|
|
37132
36949
|
}
|
|
37133
36950
|
|
|
37134
|
-
|
|
37135
|
-
|
|
37136
|
-
if (
|
|
37137
|
-
|
|
37138
|
-
|
|
37139
|
-
self.user = user
|
|
37140
|
-
self.pass = pass
|
|
37141
|
-
self.hasAuth = true
|
|
37142
|
-
var header = user + ':' + (pass || '')
|
|
37143
|
-
if (sendImmediately || typeof sendImmediately === 'undefined') {
|
|
37144
|
-
var authHeader = 'Basic ' + toBase64(header)
|
|
37145
|
-
self.sentAuth = true
|
|
37146
|
-
return authHeader
|
|
36951
|
+
Har.prototype.reducer = function (obj, pair) {
|
|
36952
|
+
// new property ?
|
|
36953
|
+
if (obj[pair.name] === undefined) {
|
|
36954
|
+
obj[pair.name] = pair.value
|
|
36955
|
+
return obj
|
|
37147
36956
|
}
|
|
36957
|
+
|
|
36958
|
+
// existing? convert to array
|
|
36959
|
+
var arr = [
|
|
36960
|
+
obj[pair.name],
|
|
36961
|
+
pair.value
|
|
36962
|
+
]
|
|
36963
|
+
|
|
36964
|
+
obj[pair.name] = arr
|
|
36965
|
+
|
|
36966
|
+
return obj
|
|
37148
36967
|
}
|
|
37149
36968
|
|
|
37150
|
-
|
|
37151
|
-
|
|
37152
|
-
|
|
37153
|
-
|
|
37154
|
-
|
|
37155
|
-
|
|
37156
|
-
|
|
37157
|
-
|
|
37158
|
-
|
|
37159
|
-
|
|
37160
|
-
return authHeader
|
|
36969
|
+
Har.prototype.prep = function (data) {
|
|
36970
|
+
// construct utility properties
|
|
36971
|
+
data.queryObj = {}
|
|
36972
|
+
data.headersObj = {}
|
|
36973
|
+
data.postData.jsonObj = false
|
|
36974
|
+
data.postData.paramsObj = false
|
|
36975
|
+
|
|
36976
|
+
// construct query objects
|
|
36977
|
+
if (data.queryString && data.queryString.length) {
|
|
36978
|
+
data.queryObj = data.queryString.reduce(this.reducer, {})
|
|
37161
36979
|
}
|
|
37162
|
-
}
|
|
37163
36980
|
|
|
37164
|
-
|
|
37165
|
-
|
|
37166
|
-
|
|
37167
|
-
|
|
37168
|
-
|
|
37169
|
-
|
|
37170
|
-
|
|
37171
|
-
|
|
37172
|
-
// http://tools.ietf.org/html/rfc2617#section-3
|
|
37173
|
-
// https://github.com/bagder/curl/blob/master/lib/http_digest.c
|
|
36981
|
+
// construct headers objects
|
|
36982
|
+
if (data.headers && data.headers.length) {
|
|
36983
|
+
// loweCase header keys
|
|
36984
|
+
data.headersObj = data.headers.reduceRight(function (headers, header) {
|
|
36985
|
+
headers[header.name] = header.value
|
|
36986
|
+
return headers
|
|
36987
|
+
}, {})
|
|
36988
|
+
}
|
|
37174
36989
|
|
|
37175
|
-
|
|
36990
|
+
// construct Cookie header
|
|
36991
|
+
if (data.cookies && data.cookies.length) {
|
|
36992
|
+
var cookies = data.cookies.map(function (cookie) {
|
|
36993
|
+
return cookie.name + '=' + cookie.value
|
|
36994
|
+
})
|
|
37176
36995
|
|
|
37177
|
-
|
|
37178
|
-
|
|
37179
|
-
while (true) {
|
|
37180
|
-
var match = re.exec(authHeader)
|
|
37181
|
-
if (!match) {
|
|
37182
|
-
break
|
|
36996
|
+
if (cookies.length) {
|
|
36997
|
+
data.headersObj.cookie = cookies.join('; ')
|
|
37183
36998
|
}
|
|
37184
|
-
challenge[match[1]] = match[2] || match[3]
|
|
37185
36999
|
}
|
|
37186
37000
|
|
|
37187
|
-
|
|
37188
|
-
|
|
37189
|
-
|
|
37190
|
-
|
|
37191
|
-
|
|
37192
|
-
|
|
37193
|
-
|
|
37194
|
-
|
|
37195
|
-
|
|
37196
|
-
|
|
37197
|
-
|
|
37198
|
-
|
|
37001
|
+
// prep body
|
|
37002
|
+
function some (arr) {
|
|
37003
|
+
return arr.some(function (type) {
|
|
37004
|
+
return data.postData.mimeType.indexOf(type) === 0
|
|
37005
|
+
})
|
|
37006
|
+
}
|
|
37007
|
+
|
|
37008
|
+
if (some([
|
|
37009
|
+
'multipart/mixed',
|
|
37010
|
+
'multipart/related',
|
|
37011
|
+
'multipart/form-data',
|
|
37012
|
+
'multipart/alternative'])) {
|
|
37013
|
+
// reset values
|
|
37014
|
+
data.postData.mimeType = 'multipart/form-data'
|
|
37015
|
+
} else if (some([
|
|
37016
|
+
'application/x-www-form-urlencoded'])) {
|
|
37017
|
+
if (!data.postData.params) {
|
|
37018
|
+
data.postData.text = ''
|
|
37199
37019
|
} else {
|
|
37200
|
-
|
|
37020
|
+
data.postData.paramsObj = data.postData.params.reduce(this.reducer, {})
|
|
37021
|
+
|
|
37022
|
+
// always overwrite
|
|
37023
|
+
data.postData.text = qs.stringify(data.postData.paramsObj)
|
|
37201
37024
|
}
|
|
37202
|
-
}
|
|
37025
|
+
} else if (some([
|
|
37026
|
+
'text/json',
|
|
37027
|
+
'text/x-json',
|
|
37028
|
+
'application/json',
|
|
37029
|
+
'application/x-json'])) {
|
|
37030
|
+
data.postData.mimeType = 'application/json'
|
|
37203
37031
|
|
|
37204
|
-
|
|
37205
|
-
|
|
37206
|
-
|
|
37207
|
-
|
|
37208
|
-
|
|
37209
|
-
var digestResponse = qop
|
|
37210
|
-
? md5(ha1 + ':' + challenge.nonce + ':' + nc + ':' + cnonce + ':' + qop + ':' + ha2)
|
|
37211
|
-
: md5(ha1 + ':' + challenge.nonce + ':' + ha2)
|
|
37212
|
-
var authValues = {
|
|
37213
|
-
username: self.user,
|
|
37214
|
-
realm: challenge.realm,
|
|
37215
|
-
nonce: challenge.nonce,
|
|
37216
|
-
uri: path,
|
|
37217
|
-
qop: qop,
|
|
37218
|
-
response: digestResponse,
|
|
37219
|
-
nc: nc,
|
|
37220
|
-
cnonce: cnonce,
|
|
37221
|
-
algorithm: challenge.algorithm,
|
|
37222
|
-
opaque: challenge.opaque
|
|
37223
|
-
}
|
|
37032
|
+
if (data.postData.text) {
|
|
37033
|
+
try {
|
|
37034
|
+
data.postData.jsonObj = JSON.parse(data.postData.text)
|
|
37035
|
+
} catch (e) {
|
|
37036
|
+
this.request.debug(e)
|
|
37224
37037
|
|
|
37225
|
-
|
|
37226
|
-
|
|
37227
|
-
if (authValues[k]) {
|
|
37228
|
-
if (k === 'qop' || k === 'nc' || k === 'algorithm') {
|
|
37229
|
-
authHeader.push(k + '=' + authValues[k])
|
|
37230
|
-
} else {
|
|
37231
|
-
authHeader.push(k + '="' + authValues[k] + '"')
|
|
37038
|
+
// force back to text/plain
|
|
37039
|
+
data.postData.mimeType = 'text/plain'
|
|
37232
37040
|
}
|
|
37233
37041
|
}
|
|
37234
37042
|
}
|
|
37235
|
-
|
|
37236
|
-
|
|
37237
|
-
return authHeader
|
|
37043
|
+
|
|
37044
|
+
return data
|
|
37238
37045
|
}
|
|
37239
37046
|
|
|
37240
|
-
|
|
37241
|
-
|
|
37242
|
-
|
|
37047
|
+
Har.prototype.options = function (options) {
|
|
37048
|
+
// skip if no har property defined
|
|
37049
|
+
if (!options.har) {
|
|
37050
|
+
return options
|
|
37051
|
+
}
|
|
37243
37052
|
|
|
37244
|
-
var
|
|
37245
|
-
|
|
37246
|
-
|
|
37247
|
-
|
|
37248
|
-
|
|
37249
|
-
|
|
37250
|
-
authHeader = self.basic(user, pass, sendImmediately)
|
|
37053
|
+
var har = {}
|
|
37054
|
+
extend(har, options.har)
|
|
37055
|
+
|
|
37056
|
+
// only process the first entry
|
|
37057
|
+
if (har.log && har.log.entries) {
|
|
37058
|
+
har = har.log.entries[0]
|
|
37251
37059
|
}
|
|
37252
|
-
|
|
37253
|
-
|
|
37060
|
+
|
|
37061
|
+
// add optional properties to make validation successful
|
|
37062
|
+
har.url = har.url || options.url || options.uri || options.baseUrl || '/'
|
|
37063
|
+
har.httpVersion = har.httpVersion || 'HTTP/1.1'
|
|
37064
|
+
har.queryString = har.queryString || []
|
|
37065
|
+
har.headers = har.headers || []
|
|
37066
|
+
har.cookies = har.cookies || []
|
|
37067
|
+
har.postData = har.postData || {}
|
|
37068
|
+
har.postData.mimeType = har.postData.mimeType || 'application/octet-stream'
|
|
37069
|
+
|
|
37070
|
+
har.bodySize = 0
|
|
37071
|
+
har.headersSize = 0
|
|
37072
|
+
har.postData.size = 0
|
|
37073
|
+
|
|
37074
|
+
if (!validate.request(har)) {
|
|
37075
|
+
return options
|
|
37254
37076
|
}
|
|
37255
|
-
}
|
|
37256
37077
|
|
|
37257
|
-
|
|
37258
|
-
var
|
|
37259
|
-
var request = self.request
|
|
37078
|
+
// clean up and get some utility properties
|
|
37079
|
+
var req = this.prep(har)
|
|
37260
37080
|
|
|
37261
|
-
|
|
37081
|
+
// construct new options
|
|
37082
|
+
if (req.url) {
|
|
37083
|
+
options.url = req.url
|
|
37084
|
+
}
|
|
37085
|
+
|
|
37086
|
+
if (req.method) {
|
|
37087
|
+
options.method = req.method
|
|
37088
|
+
}
|
|
37089
|
+
|
|
37090
|
+
if (Object.keys(req.queryObj).length) {
|
|
37091
|
+
options.qs = req.queryObj
|
|
37092
|
+
}
|
|
37093
|
+
|
|
37094
|
+
if (Object.keys(req.headersObj).length) {
|
|
37095
|
+
options.headers = req.headersObj
|
|
37096
|
+
}
|
|
37097
|
+
|
|
37098
|
+
function test (type) {
|
|
37099
|
+
return req.postData.mimeType.indexOf(type) === 0
|
|
37100
|
+
}
|
|
37101
|
+
if (test('application/x-www-form-urlencoded')) {
|
|
37102
|
+
options.form = req.postData.paramsObj
|
|
37103
|
+
} else if (test('application/json')) {
|
|
37104
|
+
if (req.postData.jsonObj) {
|
|
37105
|
+
options.body = req.postData.jsonObj
|
|
37106
|
+
options.json = true
|
|
37107
|
+
}
|
|
37108
|
+
} else if (test('multipart/form-data')) {
|
|
37109
|
+
options.formData = {}
|
|
37262
37110
|
|
|
37263
|
-
|
|
37111
|
+
req.postData.params.forEach(function (param) {
|
|
37112
|
+
var attachment = {}
|
|
37264
37113
|
|
|
37265
|
-
|
|
37266
|
-
|
|
37267
|
-
|
|
37114
|
+
if (!param.fileName && !param.contentType) {
|
|
37115
|
+
options.formData[param.name] = param.value
|
|
37116
|
+
return
|
|
37117
|
+
}
|
|
37268
37118
|
|
|
37269
|
-
|
|
37270
|
-
|
|
37271
|
-
|
|
37119
|
+
// attempt to read from disk!
|
|
37120
|
+
if (param.fileName && !param.value) {
|
|
37121
|
+
attachment.value = fs.createReadStream(param.fileName)
|
|
37122
|
+
} else if (param.value) {
|
|
37123
|
+
attachment.value = param.value
|
|
37124
|
+
}
|
|
37272
37125
|
|
|
37273
|
-
|
|
37274
|
-
|
|
37126
|
+
if (param.fileName) {
|
|
37127
|
+
attachment.options = {
|
|
37128
|
+
filename: param.fileName,
|
|
37129
|
+
contentType: param.contentType ? param.contentType : null
|
|
37130
|
+
}
|
|
37131
|
+
}
|
|
37275
37132
|
|
|
37276
|
-
|
|
37277
|
-
|
|
37133
|
+
options.formData[param.name] = attachment
|
|
37134
|
+
})
|
|
37135
|
+
} else {
|
|
37136
|
+
if (req.postData.text) {
|
|
37137
|
+
options.body = req.postData.text
|
|
37138
|
+
}
|
|
37278
37139
|
}
|
|
37140
|
+
|
|
37141
|
+
return options
|
|
37279
37142
|
}
|
|
37280
37143
|
|
|
37281
|
-
exports.
|
|
37144
|
+
exports.t = Har
|
|
37282
37145
|
|
|
37283
37146
|
|
|
37284
37147
|
/***/ }),
|
|
37285
37148
|
|
|
37286
|
-
/***/
|
|
37149
|
+
/***/ 57372:
|
|
37287
37150
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
37288
37151
|
|
|
37289
37152
|
"use strict";
|
|
37290
37153
|
|
|
37291
37154
|
|
|
37292
|
-
var
|
|
37293
|
-
|
|
37294
|
-
var Cookie = tough.Cookie
|
|
37295
|
-
var CookieJar = tough.CookieJar
|
|
37155
|
+
var crypto = __webpack_require__(76417)
|
|
37296
37156
|
|
|
37297
|
-
|
|
37298
|
-
|
|
37299
|
-
|
|
37300
|
-
|
|
37301
|
-
|
|
37302
|
-
throw new Error('The cookie function only accepts STRING as param')
|
|
37303
|
-
}
|
|
37304
|
-
return Cookie.parse(str, {loose: true})
|
|
37157
|
+
function randomString (size) {
|
|
37158
|
+
var bits = (size + 1) * 6
|
|
37159
|
+
var buffer = crypto.randomBytes(Math.ceil(bits / 8))
|
|
37160
|
+
var string = buffer.toString('base64').replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, '')
|
|
37161
|
+
return string.slice(0, size)
|
|
37305
37162
|
}
|
|
37306
37163
|
|
|
37307
|
-
|
|
37308
|
-
|
|
37309
|
-
|
|
37310
|
-
|
|
37311
|
-
|
|
37312
|
-
|
|
37313
|
-
|
|
37314
|
-
return self._jar.setCookieSync(cookieOrStr, uri, options || {})
|
|
37315
|
-
}
|
|
37316
|
-
RequestJar.prototype.getCookieString = function (uri) {
|
|
37317
|
-
var self = this
|
|
37318
|
-
return self._jar.getCookieStringSync(uri)
|
|
37319
|
-
}
|
|
37320
|
-
RequestJar.prototype.getCookies = function (uri) {
|
|
37321
|
-
var self = this
|
|
37322
|
-
return self._jar.getCookiesSync(uri)
|
|
37164
|
+
function calculatePayloadHash (payload, algorithm, contentType) {
|
|
37165
|
+
var hash = crypto.createHash(algorithm)
|
|
37166
|
+
hash.update('hawk.1.payload\n')
|
|
37167
|
+
hash.update((contentType ? contentType.split(';')[0].trim().toLowerCase() : '') + '\n')
|
|
37168
|
+
hash.update(payload || '')
|
|
37169
|
+
hash.update('\n')
|
|
37170
|
+
return hash.digest('base64')
|
|
37323
37171
|
}
|
|
37324
37172
|
|
|
37325
|
-
exports.
|
|
37326
|
-
|
|
37327
|
-
|
|
37173
|
+
exports.calculateMac = function (credentials, opts) {
|
|
37174
|
+
var normalized = 'hawk.1.header\n' +
|
|
37175
|
+
opts.ts + '\n' +
|
|
37176
|
+
opts.nonce + '\n' +
|
|
37177
|
+
(opts.method || '').toUpperCase() + '\n' +
|
|
37178
|
+
opts.resource + '\n' +
|
|
37179
|
+
opts.host.toLowerCase() + '\n' +
|
|
37180
|
+
opts.port + '\n' +
|
|
37181
|
+
(opts.hash || '') + '\n'
|
|
37328
37182
|
|
|
37183
|
+
if (opts.ext) {
|
|
37184
|
+
normalized = normalized + opts.ext.replace('\\', '\\\\').replace('\n', '\\n')
|
|
37185
|
+
}
|
|
37329
37186
|
|
|
37330
|
-
|
|
37187
|
+
normalized = normalized + '\n'
|
|
37331
37188
|
|
|
37332
|
-
|
|
37333
|
-
|
|
37189
|
+
if (opts.app) {
|
|
37190
|
+
normalized = normalized + opts.app + '\n' + (opts.dlg || '') + '\n'
|
|
37191
|
+
}
|
|
37334
37192
|
|
|
37335
|
-
|
|
37193
|
+
var hmac = crypto.createHmac(credentials.algorithm, credentials.key).update(normalized)
|
|
37194
|
+
var digest = hmac.digest('base64')
|
|
37195
|
+
return digest
|
|
37196
|
+
}
|
|
37336
37197
|
|
|
37198
|
+
exports.header = function (uri, method, opts) {
|
|
37199
|
+
var timestamp = opts.timestamp || Math.floor((Date.now() + (opts.localtimeOffsetMsec || 0)) / 1000)
|
|
37200
|
+
var credentials = opts.credentials
|
|
37201
|
+
if (!credentials || !credentials.id || !credentials.key || !credentials.algorithm) {
|
|
37202
|
+
return ''
|
|
37203
|
+
}
|
|
37337
37204
|
|
|
37338
|
-
|
|
37339
|
-
|
|
37340
|
-
|
|
37341
|
-
}
|
|
37205
|
+
if (['sha1', 'sha256'].indexOf(credentials.algorithm) === -1) {
|
|
37206
|
+
return ''
|
|
37207
|
+
}
|
|
37342
37208
|
|
|
37343
|
-
|
|
37344
|
-
|
|
37209
|
+
var artifacts = {
|
|
37210
|
+
ts: timestamp,
|
|
37211
|
+
nonce: opts.nonce || randomString(6),
|
|
37212
|
+
method: method,
|
|
37213
|
+
resource: uri.pathname + (uri.search || ''),
|
|
37214
|
+
host: uri.hostname,
|
|
37215
|
+
port: uri.port || (uri.protocol === 'http:' ? 80 : 443),
|
|
37216
|
+
hash: opts.hash,
|
|
37217
|
+
ext: opts.ext,
|
|
37218
|
+
app: opts.app,
|
|
37219
|
+
dlg: opts.dlg
|
|
37220
|
+
}
|
|
37345
37221
|
|
|
37346
|
-
|
|
37347
|
-
|
|
37348
|
-
|
|
37349
|
-
var hasPort = zone.indexOf(':') > -1
|
|
37222
|
+
if (!artifacts.hash && (opts.payload || opts.payload === '')) {
|
|
37223
|
+
artifacts.hash = calculatePayloadHash(opts.payload, credentials.algorithm, opts.contentType)
|
|
37224
|
+
}
|
|
37350
37225
|
|
|
37351
|
-
|
|
37226
|
+
var mac = exports.calculateMac(credentials, artifacts)
|
|
37227
|
+
|
|
37228
|
+
var hasExt = artifacts.ext !== null && artifacts.ext !== undefined && artifacts.ext !== ''
|
|
37229
|
+
var header = 'Hawk id="' + credentials.id +
|
|
37230
|
+
'", ts="' + artifacts.ts +
|
|
37231
|
+
'", nonce="' + artifacts.nonce +
|
|
37232
|
+
(artifacts.hash ? '", hash="' + artifacts.hash : '') +
|
|
37233
|
+
(hasExt ? '", ext="' + artifacts.ext.replace(/\\/g, '\\\\').replace(/"/g, '\\"') : '') +
|
|
37234
|
+
'", mac="' + mac + '"'
|
|
37235
|
+
|
|
37236
|
+
if (artifacts.app) {
|
|
37237
|
+
header = header + ', app="' + artifacts.app + (artifacts.dlg ? '", dlg="' + artifacts.dlg : '') + '"'
|
|
37238
|
+
}
|
|
37239
|
+
|
|
37240
|
+
return header
|
|
37352
37241
|
}
|
|
37353
37242
|
|
|
37354
|
-
function uriInNoProxy (uri, noProxy) {
|
|
37355
|
-
var port = uri.port || (uri.protocol === 'https:' ? '443' : '80')
|
|
37356
|
-
var hostname = formatHostname(uri.hostname)
|
|
37357
|
-
var noProxyList = noProxy.split(',')
|
|
37358
37243
|
|
|
37359
|
-
|
|
37360
|
-
return noProxyList.map(parseNoProxyZone).some(function (noProxyZone) {
|
|
37361
|
-
var isMatchedAt = hostname.indexOf(noProxyZone.hostname)
|
|
37362
|
-
var hostnameMatched = (
|
|
37363
|
-
isMatchedAt > -1 &&
|
|
37364
|
-
(isMatchedAt === hostname.length - noProxyZone.hostname.length)
|
|
37365
|
-
)
|
|
37244
|
+
/***/ }),
|
|
37366
37245
|
|
|
37367
|
-
|
|
37368
|
-
|
|
37369
|
-
}
|
|
37246
|
+
/***/ 73093:
|
|
37247
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
37370
37248
|
|
|
37371
|
-
|
|
37372
|
-
})
|
|
37373
|
-
}
|
|
37249
|
+
"use strict";
|
|
37374
37250
|
|
|
37375
|
-
function getProxyFromURI (uri) {
|
|
37376
|
-
// Decide the proper request proxy to use based on the request URI object and the
|
|
37377
|
-
// environmental variables (NO_PROXY, HTTP_PROXY, etc.)
|
|
37378
|
-
// respect NO_PROXY environment variables (see: https://lynx.invisible-island.net/lynx2.8.7/breakout/lynx_help/keystrokes/environments.html)
|
|
37379
37251
|
|
|
37380
|
-
|
|
37252
|
+
var jsonSafeStringify = __webpack_require__(37474)
|
|
37253
|
+
var crypto = __webpack_require__(76417)
|
|
37254
|
+
var Buffer = __webpack_require__(59105).Buffer
|
|
37381
37255
|
|
|
37382
|
-
|
|
37256
|
+
var defer = typeof setImmediate === 'undefined'
|
|
37257
|
+
? process.nextTick
|
|
37258
|
+
: setImmediate
|
|
37383
37259
|
|
|
37384
|
-
|
|
37385
|
-
|
|
37260
|
+
function paramsHaveRequestBody (params) {
|
|
37261
|
+
return (
|
|
37262
|
+
params.body ||
|
|
37263
|
+
params.requestBodyStream ||
|
|
37264
|
+
(params.json && typeof params.json !== 'boolean') ||
|
|
37265
|
+
params.multipart
|
|
37266
|
+
)
|
|
37267
|
+
}
|
|
37268
|
+
|
|
37269
|
+
function safeStringify (obj, replacer) {
|
|
37270
|
+
var ret
|
|
37271
|
+
try {
|
|
37272
|
+
ret = JSON.stringify(obj, replacer)
|
|
37273
|
+
} catch (e) {
|
|
37274
|
+
ret = jsonSafeStringify(obj, replacer)
|
|
37386
37275
|
}
|
|
37276
|
+
return ret
|
|
37277
|
+
}
|
|
37387
37278
|
|
|
37388
|
-
|
|
37279
|
+
function md5 (str) {
|
|
37280
|
+
return crypto.createHash('md5').update(str).digest('hex')
|
|
37281
|
+
}
|
|
37389
37282
|
|
|
37390
|
-
|
|
37391
|
-
|
|
37392
|
-
|
|
37283
|
+
function isReadStream (rs) {
|
|
37284
|
+
return rs.readable && rs.path && rs.mode
|
|
37285
|
+
}
|
|
37393
37286
|
|
|
37394
|
-
|
|
37287
|
+
function toBase64 (str) {
|
|
37288
|
+
return Buffer.from(str || '', 'utf8').toString('base64')
|
|
37289
|
+
}
|
|
37395
37290
|
|
|
37396
|
-
|
|
37397
|
-
|
|
37398
|
-
|
|
37399
|
-
|
|
37291
|
+
function copy (obj) {
|
|
37292
|
+
var o = {}
|
|
37293
|
+
Object.keys(obj).forEach(function (i) {
|
|
37294
|
+
o[i] = obj[i]
|
|
37295
|
+
})
|
|
37296
|
+
return o
|
|
37297
|
+
}
|
|
37400
37298
|
|
|
37401
|
-
|
|
37402
|
-
|
|
37403
|
-
|
|
37404
|
-
|
|
37405
|
-
|
|
37299
|
+
function version () {
|
|
37300
|
+
var numbers = process.version.replace('v', '').split('.')
|
|
37301
|
+
return {
|
|
37302
|
+
major: parseInt(numbers[0], 10),
|
|
37303
|
+
minor: parseInt(numbers[1], 10),
|
|
37304
|
+
patch: parseInt(numbers[2], 10)
|
|
37406
37305
|
}
|
|
37407
|
-
|
|
37408
|
-
// if none of that works, return null
|
|
37409
|
-
// (What uri protocol are you using then?)
|
|
37410
|
-
|
|
37411
|
-
return null
|
|
37412
37306
|
}
|
|
37413
37307
|
|
|
37414
|
-
|
|
37308
|
+
exports.paramsHaveRequestBody = paramsHaveRequestBody
|
|
37309
|
+
exports.safeStringify = safeStringify
|
|
37310
|
+
exports.md5 = md5
|
|
37311
|
+
exports.isReadStream = isReadStream
|
|
37312
|
+
exports.toBase64 = toBase64
|
|
37313
|
+
exports.copy = copy
|
|
37314
|
+
exports.version = version
|
|
37315
|
+
exports.defer = defer
|
|
37415
37316
|
|
|
37416
37317
|
|
|
37417
37318
|
/***/ }),
|
|
37418
37319
|
|
|
37419
|
-
/***/
|
|
37320
|
+
/***/ 38460:
|
|
37420
37321
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
37421
37322
|
|
|
37422
37323
|
"use strict";
|
|
37423
37324
|
|
|
37424
37325
|
|
|
37425
|
-
var
|
|
37426
|
-
var
|
|
37427
|
-
var
|
|
37428
|
-
var
|
|
37326
|
+
var uuid = __webpack_require__(69355)
|
|
37327
|
+
var CombinedStream = __webpack_require__(74041)
|
|
37328
|
+
var isstream = __webpack_require__(92104)
|
|
37329
|
+
var Buffer = __webpack_require__(59105).Buffer
|
|
37429
37330
|
|
|
37430
|
-
function
|
|
37331
|
+
function Multipart (request) {
|
|
37431
37332
|
this.request = request
|
|
37333
|
+
this.boundary = uuid()
|
|
37334
|
+
this.chunked = false
|
|
37335
|
+
this.body = null
|
|
37432
37336
|
}
|
|
37433
37337
|
|
|
37434
|
-
|
|
37435
|
-
|
|
37436
|
-
|
|
37437
|
-
|
|
37438
|
-
return obj
|
|
37439
|
-
}
|
|
37440
|
-
|
|
37441
|
-
// existing? convert to array
|
|
37442
|
-
var arr = [
|
|
37443
|
-
obj[pair.name],
|
|
37444
|
-
pair.value
|
|
37445
|
-
]
|
|
37446
|
-
|
|
37447
|
-
obj[pair.name] = arr
|
|
37448
|
-
|
|
37449
|
-
return obj
|
|
37450
|
-
}
|
|
37451
|
-
|
|
37452
|
-
Har.prototype.prep = function (data) {
|
|
37453
|
-
// construct utility properties
|
|
37454
|
-
data.queryObj = {}
|
|
37455
|
-
data.headersObj = {}
|
|
37456
|
-
data.postData.jsonObj = false
|
|
37457
|
-
data.postData.paramsObj = false
|
|
37458
|
-
|
|
37459
|
-
// construct query objects
|
|
37460
|
-
if (data.queryString && data.queryString.length) {
|
|
37461
|
-
data.queryObj = data.queryString.reduce(this.reducer, {})
|
|
37462
|
-
}
|
|
37338
|
+
Multipart.prototype.isChunked = function (options) {
|
|
37339
|
+
var self = this
|
|
37340
|
+
var chunked = false
|
|
37341
|
+
var parts = options.data || options
|
|
37463
37342
|
|
|
37464
|
-
|
|
37465
|
-
|
|
37466
|
-
// loweCase header keys
|
|
37467
|
-
data.headersObj = data.headers.reduceRight(function (headers, header) {
|
|
37468
|
-
headers[header.name] = header.value
|
|
37469
|
-
return headers
|
|
37470
|
-
}, {})
|
|
37343
|
+
if (!parts.forEach) {
|
|
37344
|
+
self.request.emit('error', new Error('Argument error, options.multipart.'))
|
|
37471
37345
|
}
|
|
37472
37346
|
|
|
37473
|
-
|
|
37474
|
-
|
|
37475
|
-
var cookies = data.cookies.map(function (cookie) {
|
|
37476
|
-
return cookie.name + '=' + cookie.value
|
|
37477
|
-
})
|
|
37478
|
-
|
|
37479
|
-
if (cookies.length) {
|
|
37480
|
-
data.headersObj.cookie = cookies.join('; ')
|
|
37481
|
-
}
|
|
37347
|
+
if (options.chunked !== undefined) {
|
|
37348
|
+
chunked = options.chunked
|
|
37482
37349
|
}
|
|
37483
37350
|
|
|
37484
|
-
|
|
37485
|
-
|
|
37486
|
-
return arr.some(function (type) {
|
|
37487
|
-
return data.postData.mimeType.indexOf(type) === 0
|
|
37488
|
-
})
|
|
37351
|
+
if (self.request.getHeader('transfer-encoding') === 'chunked') {
|
|
37352
|
+
chunked = true
|
|
37489
37353
|
}
|
|
37490
37354
|
|
|
37491
|
-
if (
|
|
37492
|
-
|
|
37493
|
-
|
|
37494
|
-
|
|
37495
|
-
'multipart/alternative'])) {
|
|
37496
|
-
// reset values
|
|
37497
|
-
data.postData.mimeType = 'multipart/form-data'
|
|
37498
|
-
} else if (some([
|
|
37499
|
-
'application/x-www-form-urlencoded'])) {
|
|
37500
|
-
if (!data.postData.params) {
|
|
37501
|
-
data.postData.text = ''
|
|
37502
|
-
} else {
|
|
37503
|
-
data.postData.paramsObj = data.postData.params.reduce(this.reducer, {})
|
|
37504
|
-
|
|
37505
|
-
// always overwrite
|
|
37506
|
-
data.postData.text = qs.stringify(data.postData.paramsObj)
|
|
37507
|
-
}
|
|
37508
|
-
} else if (some([
|
|
37509
|
-
'text/json',
|
|
37510
|
-
'text/x-json',
|
|
37511
|
-
'application/json',
|
|
37512
|
-
'application/x-json'])) {
|
|
37513
|
-
data.postData.mimeType = 'application/json'
|
|
37514
|
-
|
|
37515
|
-
if (data.postData.text) {
|
|
37516
|
-
try {
|
|
37517
|
-
data.postData.jsonObj = JSON.parse(data.postData.text)
|
|
37518
|
-
} catch (e) {
|
|
37519
|
-
this.request.debug(e)
|
|
37520
|
-
|
|
37521
|
-
// force back to text/plain
|
|
37522
|
-
data.postData.mimeType = 'text/plain'
|
|
37355
|
+
if (!chunked) {
|
|
37356
|
+
parts.forEach(function (part) {
|
|
37357
|
+
if (typeof part.body === 'undefined') {
|
|
37358
|
+
self.request.emit('error', new Error('Body attribute missing in multipart.'))
|
|
37523
37359
|
}
|
|
37524
|
-
|
|
37360
|
+
if (isstream(part.body)) {
|
|
37361
|
+
chunked = true
|
|
37362
|
+
}
|
|
37363
|
+
})
|
|
37525
37364
|
}
|
|
37526
37365
|
|
|
37527
|
-
return
|
|
37366
|
+
return chunked
|
|
37528
37367
|
}
|
|
37529
37368
|
|
|
37530
|
-
|
|
37531
|
-
|
|
37532
|
-
if (!options.har) {
|
|
37533
|
-
return options
|
|
37534
|
-
}
|
|
37535
|
-
|
|
37536
|
-
var har = {}
|
|
37537
|
-
extend(har, options.har)
|
|
37369
|
+
Multipart.prototype.setHeaders = function (chunked) {
|
|
37370
|
+
var self = this
|
|
37538
37371
|
|
|
37539
|
-
|
|
37540
|
-
|
|
37541
|
-
har = har.log.entries[0]
|
|
37372
|
+
if (chunked && !self.request.hasHeader('transfer-encoding')) {
|
|
37373
|
+
self.request.setHeader('transfer-encoding', 'chunked')
|
|
37542
37374
|
}
|
|
37543
37375
|
|
|
37544
|
-
|
|
37545
|
-
har.url = har.url || options.url || options.uri || options.baseUrl || '/'
|
|
37546
|
-
har.httpVersion = har.httpVersion || 'HTTP/1.1'
|
|
37547
|
-
har.queryString = har.queryString || []
|
|
37548
|
-
har.headers = har.headers || []
|
|
37549
|
-
har.cookies = har.cookies || []
|
|
37550
|
-
har.postData = har.postData || {}
|
|
37551
|
-
har.postData.mimeType = har.postData.mimeType || 'application/octet-stream'
|
|
37552
|
-
|
|
37553
|
-
har.bodySize = 0
|
|
37554
|
-
har.headersSize = 0
|
|
37555
|
-
har.postData.size = 0
|
|
37376
|
+
var header = self.request.getHeader('content-type')
|
|
37556
37377
|
|
|
37557
|
-
if (!
|
|
37558
|
-
|
|
37378
|
+
if (!header || header.indexOf('multipart') === -1) {
|
|
37379
|
+
self.request.setHeader('content-type', 'multipart/related; boundary=' + self.boundary)
|
|
37380
|
+
} else {
|
|
37381
|
+
if (header.indexOf('boundary') !== -1) {
|
|
37382
|
+
self.boundary = header.replace(/.*boundary=([^\s;]+).*/, '$1')
|
|
37383
|
+
} else {
|
|
37384
|
+
self.request.setHeader('content-type', header + '; boundary=' + self.boundary)
|
|
37385
|
+
}
|
|
37559
37386
|
}
|
|
37387
|
+
}
|
|
37560
37388
|
|
|
37561
|
-
|
|
37562
|
-
var
|
|
37563
|
-
|
|
37564
|
-
// construct new options
|
|
37565
|
-
if (req.url) {
|
|
37566
|
-
options.url = req.url
|
|
37567
|
-
}
|
|
37389
|
+
Multipart.prototype.build = function (parts, chunked) {
|
|
37390
|
+
var self = this
|
|
37391
|
+
var body = chunked ? new CombinedStream() : []
|
|
37568
37392
|
|
|
37569
|
-
|
|
37570
|
-
|
|
37393
|
+
function add (part) {
|
|
37394
|
+
if (typeof part === 'number') {
|
|
37395
|
+
part = part.toString()
|
|
37396
|
+
}
|
|
37397
|
+
return chunked ? body.append(part) : body.push(Buffer.from(part))
|
|
37571
37398
|
}
|
|
37572
37399
|
|
|
37573
|
-
if (
|
|
37574
|
-
|
|
37400
|
+
if (self.request.preambleCRLF) {
|
|
37401
|
+
add('\r\n')
|
|
37575
37402
|
}
|
|
37576
37403
|
|
|
37577
|
-
|
|
37578
|
-
|
|
37579
|
-
|
|
37404
|
+
parts.forEach(function (part) {
|
|
37405
|
+
var preamble = '--' + self.boundary + '\r\n'
|
|
37406
|
+
Object.keys(part).forEach(function (key) {
|
|
37407
|
+
if (key === 'body') { return }
|
|
37408
|
+
preamble += key + ': ' + part[key] + '\r\n'
|
|
37409
|
+
})
|
|
37410
|
+
preamble += '\r\n'
|
|
37411
|
+
add(preamble)
|
|
37412
|
+
add(part.body)
|
|
37413
|
+
add('\r\n')
|
|
37414
|
+
})
|
|
37415
|
+
add('--' + self.boundary + '--')
|
|
37580
37416
|
|
|
37581
|
-
|
|
37582
|
-
|
|
37417
|
+
if (self.request.postambleCRLF) {
|
|
37418
|
+
add('\r\n')
|
|
37583
37419
|
}
|
|
37584
|
-
if (test('application/x-www-form-urlencoded')) {
|
|
37585
|
-
options.form = req.postData.paramsObj
|
|
37586
|
-
} else if (test('application/json')) {
|
|
37587
|
-
if (req.postData.jsonObj) {
|
|
37588
|
-
options.body = req.postData.jsonObj
|
|
37589
|
-
options.json = true
|
|
37590
|
-
}
|
|
37591
|
-
} else if (test('multipart/form-data')) {
|
|
37592
|
-
options.formData = {}
|
|
37593
|
-
|
|
37594
|
-
req.postData.params.forEach(function (param) {
|
|
37595
|
-
var attachment = {}
|
|
37596
37420
|
|
|
37597
|
-
|
|
37598
|
-
|
|
37599
|
-
return
|
|
37600
|
-
}
|
|
37601
|
-
|
|
37602
|
-
// attempt to read from disk!
|
|
37603
|
-
if (param.fileName && !param.value) {
|
|
37604
|
-
attachment.value = fs.createReadStream(param.fileName)
|
|
37605
|
-
} else if (param.value) {
|
|
37606
|
-
attachment.value = param.value
|
|
37607
|
-
}
|
|
37421
|
+
return body
|
|
37422
|
+
}
|
|
37608
37423
|
|
|
37609
|
-
|
|
37610
|
-
|
|
37611
|
-
filename: param.fileName,
|
|
37612
|
-
contentType: param.contentType ? param.contentType : null
|
|
37613
|
-
}
|
|
37614
|
-
}
|
|
37424
|
+
Multipart.prototype.onRequest = function (options) {
|
|
37425
|
+
var self = this
|
|
37615
37426
|
|
|
37616
|
-
|
|
37617
|
-
|
|
37618
|
-
} else {
|
|
37619
|
-
if (req.postData.text) {
|
|
37620
|
-
options.body = req.postData.text
|
|
37621
|
-
}
|
|
37622
|
-
}
|
|
37427
|
+
var chunked = self.isChunked(options)
|
|
37428
|
+
var parts = options.data || options
|
|
37623
37429
|
|
|
37624
|
-
|
|
37430
|
+
self.setHeaders(chunked)
|
|
37431
|
+
self.chunked = chunked
|
|
37432
|
+
self.body = self.build(parts, chunked)
|
|
37625
37433
|
}
|
|
37626
37434
|
|
|
37627
|
-
exports
|
|
37435
|
+
exports.$ = Multipart
|
|
37628
37436
|
|
|
37629
37437
|
|
|
37630
37438
|
/***/ }),
|
|
37631
37439
|
|
|
37632
|
-
/***/
|
|
37440
|
+
/***/ 63055:
|
|
37633
37441
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
37634
37442
|
|
|
37635
37443
|
"use strict";
|
|
37636
37444
|
|
|
37637
37445
|
|
|
37446
|
+
var url = __webpack_require__(78835)
|
|
37447
|
+
var qs = __webpack_require__(88889)
|
|
37448
|
+
var caseless = __webpack_require__(72464)
|
|
37449
|
+
var uuid = __webpack_require__(69355)
|
|
37450
|
+
var oauth = __webpack_require__(14094)
|
|
37638
37451
|
var crypto = __webpack_require__(76417)
|
|
37452
|
+
var Buffer = __webpack_require__(59105).Buffer
|
|
37639
37453
|
|
|
37640
|
-
function
|
|
37641
|
-
|
|
37642
|
-
|
|
37643
|
-
var string = buffer.toString('base64').replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, '')
|
|
37644
|
-
return string.slice(0, size)
|
|
37454
|
+
function OAuth (request) {
|
|
37455
|
+
this.request = request
|
|
37456
|
+
this.params = null
|
|
37645
37457
|
}
|
|
37646
37458
|
|
|
37647
|
-
function
|
|
37648
|
-
var
|
|
37649
|
-
|
|
37650
|
-
|
|
37651
|
-
|
|
37652
|
-
|
|
37653
|
-
|
|
37654
|
-
}
|
|
37459
|
+
OAuth.prototype.buildParams = function (_oauth, uri, method, query, form, qsLib) {
|
|
37460
|
+
var oa = {}
|
|
37461
|
+
for (var i in _oauth) {
|
|
37462
|
+
oa['oauth_' + i] = _oauth[i]
|
|
37463
|
+
}
|
|
37464
|
+
if (!oa.oauth_version) {
|
|
37465
|
+
oa.oauth_version = '1.0'
|
|
37466
|
+
}
|
|
37467
|
+
if (!oa.oauth_timestamp) {
|
|
37468
|
+
oa.oauth_timestamp = Math.floor(Date.now() / 1000).toString()
|
|
37469
|
+
}
|
|
37470
|
+
if (!oa.oauth_nonce) {
|
|
37471
|
+
oa.oauth_nonce = uuid().replace(/-/g, '')
|
|
37472
|
+
}
|
|
37473
|
+
if (!oa.oauth_signature_method) {
|
|
37474
|
+
oa.oauth_signature_method = 'HMAC-SHA1'
|
|
37475
|
+
}
|
|
37655
37476
|
|
|
37656
|
-
|
|
37657
|
-
|
|
37658
|
-
|
|
37659
|
-
opts.nonce + '\n' +
|
|
37660
|
-
(opts.method || '').toUpperCase() + '\n' +
|
|
37661
|
-
opts.resource + '\n' +
|
|
37662
|
-
opts.host.toLowerCase() + '\n' +
|
|
37663
|
-
opts.port + '\n' +
|
|
37664
|
-
(opts.hash || '') + '\n'
|
|
37477
|
+
var consumer_secret_or_private_key = oa.oauth_consumer_secret || oa.oauth_private_key // eslint-disable-line camelcase
|
|
37478
|
+
delete oa.oauth_consumer_secret
|
|
37479
|
+
delete oa.oauth_private_key
|
|
37665
37480
|
|
|
37666
|
-
|
|
37667
|
-
|
|
37668
|
-
}
|
|
37481
|
+
var token_secret = oa.oauth_token_secret // eslint-disable-line camelcase
|
|
37482
|
+
delete oa.oauth_token_secret
|
|
37669
37483
|
|
|
37670
|
-
|
|
37484
|
+
var realm = oa.oauth_realm
|
|
37485
|
+
delete oa.oauth_realm
|
|
37486
|
+
delete oa.oauth_transport_method
|
|
37671
37487
|
|
|
37672
|
-
|
|
37673
|
-
|
|
37488
|
+
var baseurl = uri.protocol + '//' + uri.host + uri.pathname
|
|
37489
|
+
var params = qsLib.parse([].concat(query, form, qsLib.stringify(oa)).join('&'))
|
|
37490
|
+
|
|
37491
|
+
oa.oauth_signature = oauth.sign(
|
|
37492
|
+
oa.oauth_signature_method,
|
|
37493
|
+
method,
|
|
37494
|
+
baseurl,
|
|
37495
|
+
params,
|
|
37496
|
+
consumer_secret_or_private_key, // eslint-disable-line camelcase
|
|
37497
|
+
token_secret // eslint-disable-line camelcase
|
|
37498
|
+
)
|
|
37499
|
+
|
|
37500
|
+
if (realm) {
|
|
37501
|
+
oa.realm = realm
|
|
37674
37502
|
}
|
|
37675
37503
|
|
|
37676
|
-
|
|
37677
|
-
var digest = hmac.digest('base64')
|
|
37678
|
-
return digest
|
|
37504
|
+
return oa
|
|
37679
37505
|
}
|
|
37680
37506
|
|
|
37681
|
-
|
|
37682
|
-
|
|
37683
|
-
|
|
37684
|
-
|
|
37685
|
-
return ''
|
|
37507
|
+
OAuth.prototype.buildBodyHash = function (_oauth, body) {
|
|
37508
|
+
if (['HMAC-SHA1', 'RSA-SHA1'].indexOf(_oauth.signature_method || 'HMAC-SHA1') < 0) {
|
|
37509
|
+
this.request.emit('error', new Error('oauth: ' + _oauth.signature_method +
|
|
37510
|
+
' signature_method not supported with body_hash signing.'))
|
|
37686
37511
|
}
|
|
37687
37512
|
|
|
37688
|
-
|
|
37689
|
-
|
|
37513
|
+
var shasum = crypto.createHash('sha1')
|
|
37514
|
+
shasum.update(body || '')
|
|
37515
|
+
var sha1 = shasum.digest('hex')
|
|
37516
|
+
|
|
37517
|
+
return Buffer.from(sha1, 'hex').toString('base64')
|
|
37518
|
+
}
|
|
37519
|
+
|
|
37520
|
+
OAuth.prototype.concatParams = function (oa, sep, wrap) {
|
|
37521
|
+
wrap = wrap || ''
|
|
37522
|
+
|
|
37523
|
+
var params = Object.keys(oa).filter(function (i) {
|
|
37524
|
+
return i !== 'realm' && i !== 'oauth_signature'
|
|
37525
|
+
}).sort()
|
|
37526
|
+
|
|
37527
|
+
if (oa.realm) {
|
|
37528
|
+
params.splice(0, 0, 'realm')
|
|
37690
37529
|
}
|
|
37530
|
+
params.push('oauth_signature')
|
|
37691
37531
|
|
|
37692
|
-
|
|
37693
|
-
|
|
37694
|
-
|
|
37695
|
-
|
|
37696
|
-
|
|
37697
|
-
|
|
37698
|
-
|
|
37699
|
-
|
|
37700
|
-
|
|
37701
|
-
|
|
37702
|
-
|
|
37532
|
+
return params.map(function (i) {
|
|
37533
|
+
return i + '=' + wrap + oauth.rfc3986(oa[i]) + wrap
|
|
37534
|
+
}).join(sep)
|
|
37535
|
+
}
|
|
37536
|
+
|
|
37537
|
+
OAuth.prototype.onRequest = function (_oauth) {
|
|
37538
|
+
var self = this
|
|
37539
|
+
self.params = _oauth
|
|
37540
|
+
|
|
37541
|
+
var uri = self.request.uri || {}
|
|
37542
|
+
var method = self.request.method || ''
|
|
37543
|
+
var headers = caseless(self.request.headers)
|
|
37544
|
+
var body = self.request.body || ''
|
|
37545
|
+
var qsLib = self.request.qsLib || qs
|
|
37546
|
+
|
|
37547
|
+
var form
|
|
37548
|
+
var query
|
|
37549
|
+
var contentType = headers.get('content-type') || ''
|
|
37550
|
+
var formContentType = 'application/x-www-form-urlencoded'
|
|
37551
|
+
var transport = _oauth.transport_method || 'header'
|
|
37552
|
+
|
|
37553
|
+
if (contentType.slice(0, formContentType.length) === formContentType) {
|
|
37554
|
+
contentType = formContentType
|
|
37555
|
+
form = body
|
|
37556
|
+
}
|
|
37557
|
+
if (uri.query) {
|
|
37558
|
+
query = uri.query
|
|
37559
|
+
}
|
|
37560
|
+
if (transport === 'body' && (method !== 'POST' || contentType !== formContentType)) {
|
|
37561
|
+
self.request.emit('error', new Error('oauth: transport_method of body requires POST ' +
|
|
37562
|
+
'and content-type ' + formContentType))
|
|
37703
37563
|
}
|
|
37704
37564
|
|
|
37705
|
-
if (!
|
|
37706
|
-
|
|
37565
|
+
if (!form && typeof _oauth.body_hash === 'boolean') {
|
|
37566
|
+
_oauth.body_hash = self.buildBodyHash(_oauth, self.request.body.toString())
|
|
37707
37567
|
}
|
|
37708
37568
|
|
|
37709
|
-
var
|
|
37569
|
+
var oa = self.buildParams(_oauth, uri, method, query, form, qsLib)
|
|
37710
37570
|
|
|
37711
|
-
|
|
37712
|
-
|
|
37713
|
-
|
|
37714
|
-
|
|
37715
|
-
(artifacts.hash ? '", hash="' + artifacts.hash : '') +
|
|
37716
|
-
(hasExt ? '", ext="' + artifacts.ext.replace(/\\/g, '\\\\').replace(/"/g, '\\"') : '') +
|
|
37717
|
-
'", mac="' + mac + '"'
|
|
37571
|
+
switch (transport) {
|
|
37572
|
+
case 'header':
|
|
37573
|
+
self.request.setHeader('Authorization', 'OAuth ' + self.concatParams(oa, ',', '"'))
|
|
37574
|
+
break
|
|
37718
37575
|
|
|
37719
|
-
|
|
37720
|
-
|
|
37721
|
-
|
|
37576
|
+
case 'query':
|
|
37577
|
+
var href = self.request.uri.href += (query ? '&' : '?') + self.concatParams(oa, '&')
|
|
37578
|
+
self.request.uri = url.parse(href)
|
|
37579
|
+
self.request.path = self.request.uri.path
|
|
37580
|
+
break
|
|
37722
37581
|
|
|
37723
|
-
|
|
37582
|
+
case 'body':
|
|
37583
|
+
self.request.body = (form ? form + '&' : '') + self.concatParams(oa, '&')
|
|
37584
|
+
break
|
|
37585
|
+
|
|
37586
|
+
default:
|
|
37587
|
+
self.request.emit('error', new Error('oauth: transport_method invalid'))
|
|
37588
|
+
}
|
|
37724
37589
|
}
|
|
37725
37590
|
|
|
37591
|
+
exports.f = OAuth
|
|
37592
|
+
|
|
37726
37593
|
|
|
37727
37594
|
/***/ }),
|
|
37728
37595
|
|
|
37729
|
-
/***/
|
|
37596
|
+
/***/ 84395:
|
|
37730
37597
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
37731
37598
|
|
|
37732
37599
|
"use strict";
|
|
37733
37600
|
|
|
37734
37601
|
|
|
37735
|
-
var
|
|
37736
|
-
var
|
|
37737
|
-
var Buffer = __webpack_require__(59105).Buffer
|
|
37738
|
-
|
|
37739
|
-
var defer = typeof setImmediate === 'undefined'
|
|
37740
|
-
? process.nextTick
|
|
37741
|
-
: setImmediate
|
|
37602
|
+
var qs = __webpack_require__(88889)
|
|
37603
|
+
var querystring = __webpack_require__(71191)
|
|
37742
37604
|
|
|
37743
|
-
function
|
|
37744
|
-
|
|
37745
|
-
|
|
37746
|
-
|
|
37747
|
-
|
|
37748
|
-
|
|
37749
|
-
)
|
|
37605
|
+
function Querystring (request) {
|
|
37606
|
+
this.request = request
|
|
37607
|
+
this.lib = null
|
|
37608
|
+
this.useQuerystring = null
|
|
37609
|
+
this.parseOptions = null
|
|
37610
|
+
this.stringifyOptions = null
|
|
37750
37611
|
}
|
|
37751
37612
|
|
|
37752
|
-
function
|
|
37753
|
-
|
|
37754
|
-
try {
|
|
37755
|
-
ret = JSON.stringify(obj, replacer)
|
|
37756
|
-
} catch (e) {
|
|
37757
|
-
ret = jsonSafeStringify(obj, replacer)
|
|
37758
|
-
}
|
|
37759
|
-
return ret
|
|
37760
|
-
}
|
|
37613
|
+
Querystring.prototype.init = function (options) {
|
|
37614
|
+
if (this.lib) { return }
|
|
37761
37615
|
|
|
37762
|
-
|
|
37763
|
-
|
|
37616
|
+
this.useQuerystring = options.useQuerystring
|
|
37617
|
+
this.lib = (this.useQuerystring ? querystring : qs)
|
|
37618
|
+
|
|
37619
|
+
this.parseOptions = options.qsParseOptions || {}
|
|
37620
|
+
this.stringifyOptions = options.qsStringifyOptions || {}
|
|
37764
37621
|
}
|
|
37765
37622
|
|
|
37766
|
-
function
|
|
37767
|
-
return
|
|
37623
|
+
Querystring.prototype.stringify = function (obj) {
|
|
37624
|
+
return (this.useQuerystring)
|
|
37625
|
+
? this.rfc3986(this.lib.stringify(obj,
|
|
37626
|
+
this.stringifyOptions.sep || null,
|
|
37627
|
+
this.stringifyOptions.eq || null,
|
|
37628
|
+
this.stringifyOptions))
|
|
37629
|
+
: this.lib.stringify(obj, this.stringifyOptions)
|
|
37768
37630
|
}
|
|
37769
37631
|
|
|
37770
|
-
function
|
|
37771
|
-
return
|
|
37632
|
+
Querystring.prototype.parse = function (str) {
|
|
37633
|
+
return (this.useQuerystring)
|
|
37634
|
+
? this.lib.parse(str,
|
|
37635
|
+
this.parseOptions.sep || null,
|
|
37636
|
+
this.parseOptions.eq || null,
|
|
37637
|
+
this.parseOptions)
|
|
37638
|
+
: this.lib.parse(str, this.parseOptions)
|
|
37772
37639
|
}
|
|
37773
37640
|
|
|
37774
|
-
function
|
|
37775
|
-
|
|
37776
|
-
|
|
37777
|
-
o[i] = obj[i]
|
|
37641
|
+
Querystring.prototype.rfc3986 = function (str) {
|
|
37642
|
+
return str.replace(/[!'()*]/g, function (c) {
|
|
37643
|
+
return '%' + c.charCodeAt(0).toString(16).toUpperCase()
|
|
37778
37644
|
})
|
|
37779
|
-
return o
|
|
37780
37645
|
}
|
|
37781
37646
|
|
|
37782
|
-
|
|
37783
|
-
var numbers = process.version.replace('v', '').split('.')
|
|
37784
|
-
return {
|
|
37785
|
-
major: parseInt(numbers[0], 10),
|
|
37786
|
-
minor: parseInt(numbers[1], 10),
|
|
37787
|
-
patch: parseInt(numbers[2], 10)
|
|
37788
|
-
}
|
|
37789
|
-
}
|
|
37647
|
+
Querystring.prototype.unescape = querystring.unescape
|
|
37790
37648
|
|
|
37791
|
-
exports.
|
|
37792
|
-
exports.safeStringify = safeStringify
|
|
37793
|
-
exports.md5 = md5
|
|
37794
|
-
exports.isReadStream = isReadStream
|
|
37795
|
-
exports.toBase64 = toBase64
|
|
37796
|
-
exports.copy = copy
|
|
37797
|
-
exports.version = version
|
|
37798
|
-
exports.defer = defer
|
|
37649
|
+
exports.h = Querystring
|
|
37799
37650
|
|
|
37800
37651
|
|
|
37801
37652
|
/***/ }),
|
|
37802
37653
|
|
|
37803
|
-
/***/
|
|
37654
|
+
/***/ 29935:
|
|
37804
37655
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
37805
37656
|
|
|
37806
37657
|
"use strict";
|
|
37807
37658
|
|
|
37808
37659
|
|
|
37809
|
-
var
|
|
37810
|
-
var
|
|
37811
|
-
var isstream = __webpack_require__(92104)
|
|
37812
|
-
var Buffer = __webpack_require__(59105).Buffer
|
|
37660
|
+
var url = __webpack_require__(78835)
|
|
37661
|
+
var isUrl = /^https?:/
|
|
37813
37662
|
|
|
37814
|
-
function
|
|
37663
|
+
function Redirect (request) {
|
|
37815
37664
|
this.request = request
|
|
37816
|
-
this.
|
|
37817
|
-
this.
|
|
37818
|
-
this.
|
|
37665
|
+
this.followRedirect = true
|
|
37666
|
+
this.followRedirects = true
|
|
37667
|
+
this.followAllRedirects = false
|
|
37668
|
+
this.followOriginalHttpMethod = false
|
|
37669
|
+
this.allowRedirect = function () { return true }
|
|
37670
|
+
this.maxRedirects = 10
|
|
37671
|
+
this.redirects = []
|
|
37672
|
+
this.redirectsFollowed = 0
|
|
37673
|
+
this.removeRefererHeader = false
|
|
37819
37674
|
}
|
|
37820
37675
|
|
|
37821
|
-
|
|
37676
|
+
Redirect.prototype.onRequest = function (options) {
|
|
37822
37677
|
var self = this
|
|
37823
|
-
var chunked = false
|
|
37824
|
-
var parts = options.data || options
|
|
37825
37678
|
|
|
37826
|
-
if (
|
|
37827
|
-
self.
|
|
37679
|
+
if (options.maxRedirects !== undefined) {
|
|
37680
|
+
self.maxRedirects = options.maxRedirects
|
|
37828
37681
|
}
|
|
37829
|
-
|
|
37830
|
-
|
|
37831
|
-
chunked = options.chunked
|
|
37682
|
+
if (typeof options.followRedirect === 'function') {
|
|
37683
|
+
self.allowRedirect = options.followRedirect
|
|
37832
37684
|
}
|
|
37833
|
-
|
|
37834
|
-
|
|
37835
|
-
|
|
37685
|
+
if (options.followRedirect !== undefined) {
|
|
37686
|
+
self.followRedirects = !!options.followRedirect
|
|
37687
|
+
}
|
|
37688
|
+
if (options.followAllRedirects !== undefined) {
|
|
37689
|
+
self.followAllRedirects = options.followAllRedirects
|
|
37836
37690
|
}
|
|
37691
|
+
if (self.followRedirects || self.followAllRedirects) {
|
|
37692
|
+
self.redirects = self.redirects || []
|
|
37693
|
+
}
|
|
37694
|
+
if (options.removeRefererHeader !== undefined) {
|
|
37695
|
+
self.removeRefererHeader = options.removeRefererHeader
|
|
37696
|
+
}
|
|
37697
|
+
if (options.followOriginalHttpMethod !== undefined) {
|
|
37698
|
+
self.followOriginalHttpMethod = options.followOriginalHttpMethod
|
|
37699
|
+
}
|
|
37700
|
+
}
|
|
37837
37701
|
|
|
37838
|
-
|
|
37839
|
-
|
|
37840
|
-
|
|
37841
|
-
|
|
37842
|
-
|
|
37843
|
-
|
|
37844
|
-
|
|
37702
|
+
Redirect.prototype.redirectTo = function (response) {
|
|
37703
|
+
var self = this
|
|
37704
|
+
var request = self.request
|
|
37705
|
+
|
|
37706
|
+
var redirectTo = null
|
|
37707
|
+
if (response.statusCode >= 300 && response.statusCode < 400 && response.caseless.has('location')) {
|
|
37708
|
+
var location = response.caseless.get('location')
|
|
37709
|
+
request.debug('redirect', location)
|
|
37710
|
+
|
|
37711
|
+
if (self.followAllRedirects) {
|
|
37712
|
+
redirectTo = location
|
|
37713
|
+
} else if (self.followRedirects) {
|
|
37714
|
+
switch (request.method) {
|
|
37715
|
+
case 'PATCH':
|
|
37716
|
+
case 'PUT':
|
|
37717
|
+
case 'POST':
|
|
37718
|
+
case 'DELETE':
|
|
37719
|
+
// Do not follow redirects
|
|
37720
|
+
break
|
|
37721
|
+
default:
|
|
37722
|
+
redirectTo = location
|
|
37723
|
+
break
|
|
37845
37724
|
}
|
|
37846
|
-
}
|
|
37725
|
+
}
|
|
37726
|
+
} else if (response.statusCode === 401) {
|
|
37727
|
+
var authHeader = request._auth.onResponse(response)
|
|
37728
|
+
if (authHeader) {
|
|
37729
|
+
request.setHeader('authorization', authHeader)
|
|
37730
|
+
redirectTo = request.uri
|
|
37731
|
+
}
|
|
37847
37732
|
}
|
|
37848
|
-
|
|
37849
|
-
return chunked
|
|
37733
|
+
return redirectTo
|
|
37850
37734
|
}
|
|
37851
37735
|
|
|
37852
|
-
|
|
37736
|
+
Redirect.prototype.onResponse = function (response) {
|
|
37853
37737
|
var self = this
|
|
37738
|
+
var request = self.request
|
|
37854
37739
|
|
|
37855
|
-
|
|
37856
|
-
|
|
37740
|
+
var redirectTo = self.redirectTo(response)
|
|
37741
|
+
if (!redirectTo || !self.allowRedirect.call(request, response)) {
|
|
37742
|
+
return false
|
|
37857
37743
|
}
|
|
37858
37744
|
|
|
37859
|
-
|
|
37745
|
+
request.debug('redirect to', redirectTo)
|
|
37860
37746
|
|
|
37861
|
-
|
|
37862
|
-
|
|
37863
|
-
|
|
37864
|
-
|
|
37865
|
-
|
|
37866
|
-
} else {
|
|
37867
|
-
self.request.setHeader('content-type', header + '; boundary=' + self.boundary)
|
|
37868
|
-
}
|
|
37747
|
+
// ignore any potential response body. it cannot possibly be useful
|
|
37748
|
+
// to us at this point.
|
|
37749
|
+
// response.resume should be defined, but check anyway before calling. Workaround for browserify.
|
|
37750
|
+
if (response.resume) {
|
|
37751
|
+
response.resume()
|
|
37869
37752
|
}
|
|
37870
|
-
}
|
|
37871
37753
|
|
|
37872
|
-
|
|
37873
|
-
|
|
37874
|
-
|
|
37754
|
+
if (self.redirectsFollowed >= self.maxRedirects) {
|
|
37755
|
+
request.emit('error', new Error('Exceeded maxRedirects. Probably stuck in a redirect loop ' + request.uri.href))
|
|
37756
|
+
return false
|
|
37757
|
+
}
|
|
37758
|
+
self.redirectsFollowed += 1
|
|
37875
37759
|
|
|
37876
|
-
|
|
37877
|
-
|
|
37878
|
-
|
|
37760
|
+
if (!isUrl.test(redirectTo)) {
|
|
37761
|
+
redirectTo = url.resolve(request.uri.href, redirectTo)
|
|
37762
|
+
}
|
|
37763
|
+
|
|
37764
|
+
var uriPrev = request.uri
|
|
37765
|
+
request.uri = url.parse(redirectTo)
|
|
37766
|
+
|
|
37767
|
+
// handle the case where we change protocol from https to http or vice versa
|
|
37768
|
+
if (request.uri.protocol !== uriPrev.protocol) {
|
|
37769
|
+
delete request.agent
|
|
37770
|
+
}
|
|
37771
|
+
|
|
37772
|
+
self.redirects.push({ statusCode: response.statusCode, redirectUri: redirectTo })
|
|
37773
|
+
|
|
37774
|
+
if (self.followAllRedirects && request.method !== 'HEAD' &&
|
|
37775
|
+
response.statusCode !== 401 && response.statusCode !== 307) {
|
|
37776
|
+
request.method = self.followOriginalHttpMethod ? request.method : 'GET'
|
|
37777
|
+
}
|
|
37778
|
+
// request.method = 'GET' // Force all redirects to use GET || commented out fixes #215
|
|
37779
|
+
delete request.src
|
|
37780
|
+
delete request.req
|
|
37781
|
+
delete request._started
|
|
37782
|
+
if (response.statusCode !== 401 && response.statusCode !== 307) {
|
|
37783
|
+
// Remove parameters from the previous response, unless this is the second request
|
|
37784
|
+
// for a server that requires digest authentication.
|
|
37785
|
+
delete request.body
|
|
37786
|
+
delete request._form
|
|
37787
|
+
if (request.headers) {
|
|
37788
|
+
request.removeHeader('host')
|
|
37789
|
+
request.removeHeader('content-type')
|
|
37790
|
+
request.removeHeader('content-length')
|
|
37791
|
+
if (request.uri.hostname !== request.originalHost.split(':')[0]) {
|
|
37792
|
+
// Remove authorization if changing hostnames (but not if just
|
|
37793
|
+
// changing ports or protocols). This matches the behavior of curl:
|
|
37794
|
+
// https://github.com/bagder/curl/blob/6beb0eee/lib/http.c#L710
|
|
37795
|
+
request.removeHeader('authorization')
|
|
37796
|
+
}
|
|
37879
37797
|
}
|
|
37880
|
-
return chunked ? body.append(part) : body.push(Buffer.from(part))
|
|
37881
37798
|
}
|
|
37882
37799
|
|
|
37883
|
-
if (self.
|
|
37884
|
-
|
|
37800
|
+
if (!self.removeRefererHeader) {
|
|
37801
|
+
request.setHeader('referer', uriPrev.href)
|
|
37885
37802
|
}
|
|
37886
37803
|
|
|
37887
|
-
|
|
37888
|
-
|
|
37889
|
-
|
|
37890
|
-
|
|
37891
|
-
|
|
37892
|
-
|
|
37893
|
-
|
|
37894
|
-
|
|
37895
|
-
|
|
37896
|
-
|
|
37897
|
-
|
|
37898
|
-
|
|
37804
|
+
request.emit('redirect')
|
|
37805
|
+
|
|
37806
|
+
request.init()
|
|
37807
|
+
|
|
37808
|
+
return true
|
|
37809
|
+
}
|
|
37810
|
+
|
|
37811
|
+
exports.l = Redirect
|
|
37812
|
+
|
|
37813
|
+
|
|
37814
|
+
/***/ }),
|
|
37815
|
+
|
|
37816
|
+
/***/ 7141:
|
|
37817
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
37818
|
+
|
|
37819
|
+
"use strict";
|
|
37820
|
+
|
|
37821
|
+
|
|
37822
|
+
var url = __webpack_require__(78835)
|
|
37823
|
+
var tunnel = __webpack_require__(2429)
|
|
37824
|
+
|
|
37825
|
+
var defaultProxyHeaderWhiteList = [
|
|
37826
|
+
'accept',
|
|
37827
|
+
'accept-charset',
|
|
37828
|
+
'accept-encoding',
|
|
37829
|
+
'accept-language',
|
|
37830
|
+
'accept-ranges',
|
|
37831
|
+
'cache-control',
|
|
37832
|
+
'content-encoding',
|
|
37833
|
+
'content-language',
|
|
37834
|
+
'content-location',
|
|
37835
|
+
'content-md5',
|
|
37836
|
+
'content-range',
|
|
37837
|
+
'content-type',
|
|
37838
|
+
'connection',
|
|
37839
|
+
'date',
|
|
37840
|
+
'expect',
|
|
37841
|
+
'max-forwards',
|
|
37842
|
+
'pragma',
|
|
37843
|
+
'referer',
|
|
37844
|
+
'te',
|
|
37845
|
+
'user-agent',
|
|
37846
|
+
'via'
|
|
37847
|
+
]
|
|
37848
|
+
|
|
37849
|
+
var defaultProxyHeaderExclusiveList = [
|
|
37850
|
+
'proxy-authorization'
|
|
37851
|
+
]
|
|
37852
|
+
|
|
37853
|
+
function constructProxyHost (uriObject) {
|
|
37854
|
+
var port = uriObject.port
|
|
37855
|
+
var protocol = uriObject.protocol
|
|
37856
|
+
var proxyHost = uriObject.hostname + ':'
|
|
37899
37857
|
|
|
37900
|
-
if (
|
|
37901
|
-
|
|
37858
|
+
if (port) {
|
|
37859
|
+
proxyHost += port
|
|
37860
|
+
} else if (protocol === 'https:') {
|
|
37861
|
+
proxyHost += '443'
|
|
37862
|
+
} else {
|
|
37863
|
+
proxyHost += '80'
|
|
37902
37864
|
}
|
|
37903
37865
|
|
|
37904
|
-
return
|
|
37866
|
+
return proxyHost
|
|
37905
37867
|
}
|
|
37906
37868
|
|
|
37907
|
-
|
|
37908
|
-
var
|
|
37909
|
-
|
|
37910
|
-
|
|
37911
|
-
|
|
37869
|
+
function constructProxyHeaderWhiteList (headers, proxyHeaderWhiteList) {
|
|
37870
|
+
var whiteList = proxyHeaderWhiteList
|
|
37871
|
+
.reduce(function (set, header) {
|
|
37872
|
+
set[header.toLowerCase()] = true
|
|
37873
|
+
return set
|
|
37874
|
+
}, {})
|
|
37912
37875
|
|
|
37913
|
-
|
|
37914
|
-
|
|
37915
|
-
|
|
37876
|
+
return Object.keys(headers)
|
|
37877
|
+
.filter(function (header) {
|
|
37878
|
+
return whiteList[header.toLowerCase()]
|
|
37879
|
+
})
|
|
37880
|
+
.reduce(function (set, header) {
|
|
37881
|
+
set[header] = headers[header]
|
|
37882
|
+
return set
|
|
37883
|
+
}, {})
|
|
37916
37884
|
}
|
|
37917
37885
|
|
|
37918
|
-
|
|
37919
|
-
|
|
37920
|
-
|
|
37921
|
-
/***/ }),
|
|
37886
|
+
function constructTunnelOptions (request, proxyHeaders) {
|
|
37887
|
+
var proxy = request.proxy
|
|
37922
37888
|
|
|
37923
|
-
|
|
37924
|
-
|
|
37889
|
+
var tunnelOptions = {
|
|
37890
|
+
proxy: {
|
|
37891
|
+
host: proxy.hostname,
|
|
37892
|
+
port: +proxy.port,
|
|
37893
|
+
proxyAuth: proxy.auth,
|
|
37894
|
+
headers: proxyHeaders
|
|
37895
|
+
},
|
|
37896
|
+
headers: request.headers,
|
|
37897
|
+
ca: request.ca,
|
|
37898
|
+
cert: request.cert,
|
|
37899
|
+
key: request.key,
|
|
37900
|
+
passphrase: request.passphrase,
|
|
37901
|
+
pfx: request.pfx,
|
|
37902
|
+
ciphers: request.ciphers,
|
|
37903
|
+
rejectUnauthorized: request.rejectUnauthorized,
|
|
37904
|
+
secureOptions: request.secureOptions,
|
|
37905
|
+
secureProtocol: request.secureProtocol
|
|
37906
|
+
}
|
|
37925
37907
|
|
|
37926
|
-
|
|
37908
|
+
return tunnelOptions
|
|
37909
|
+
}
|
|
37927
37910
|
|
|
37911
|
+
function constructTunnelFnName (uri, proxy) {
|
|
37912
|
+
var uriProtocol = (uri.protocol === 'https:' ? 'https' : 'http')
|
|
37913
|
+
var proxyProtocol = (proxy.protocol === 'https:' ? 'Https' : 'Http')
|
|
37914
|
+
return [uriProtocol, proxyProtocol].join('Over')
|
|
37915
|
+
}
|
|
37928
37916
|
|
|
37929
|
-
|
|
37930
|
-
var
|
|
37931
|
-
var
|
|
37932
|
-
var
|
|
37933
|
-
|
|
37934
|
-
|
|
37935
|
-
var Buffer = __webpack_require__(59105).Buffer
|
|
37917
|
+
function getTunnelFn (request) {
|
|
37918
|
+
var uri = request.uri
|
|
37919
|
+
var proxy = request.proxy
|
|
37920
|
+
var tunnelFnName = constructTunnelFnName(uri, proxy)
|
|
37921
|
+
return tunnel[tunnelFnName]
|
|
37922
|
+
}
|
|
37936
37923
|
|
|
37937
|
-
function
|
|
37924
|
+
function Tunnel (request) {
|
|
37938
37925
|
this.request = request
|
|
37939
|
-
this.
|
|
37926
|
+
this.proxyHeaderWhiteList = defaultProxyHeaderWhiteList
|
|
37927
|
+
this.proxyHeaderExclusiveList = []
|
|
37928
|
+
if (typeof request.tunnel !== 'undefined') {
|
|
37929
|
+
this.tunnelOverride = request.tunnel
|
|
37930
|
+
}
|
|
37940
37931
|
}
|
|
37941
37932
|
|
|
37942
|
-
|
|
37943
|
-
var
|
|
37944
|
-
|
|
37945
|
-
|
|
37946
|
-
}
|
|
37947
|
-
if (!oa.oauth_version) {
|
|
37948
|
-
oa.oauth_version = '1.0'
|
|
37949
|
-
}
|
|
37950
|
-
if (!oa.oauth_timestamp) {
|
|
37951
|
-
oa.oauth_timestamp = Math.floor(Date.now() / 1000).toString()
|
|
37952
|
-
}
|
|
37953
|
-
if (!oa.oauth_nonce) {
|
|
37954
|
-
oa.oauth_nonce = uuid().replace(/-/g, '')
|
|
37955
|
-
}
|
|
37956
|
-
if (!oa.oauth_signature_method) {
|
|
37957
|
-
oa.oauth_signature_method = 'HMAC-SHA1'
|
|
37958
|
-
}
|
|
37933
|
+
Tunnel.prototype.isEnabled = function () {
|
|
37934
|
+
var self = this
|
|
37935
|
+
var request = self.request
|
|
37936
|
+
// Tunnel HTTPS by default. Allow the user to override this setting.
|
|
37959
37937
|
|
|
37960
|
-
|
|
37961
|
-
|
|
37962
|
-
|
|
37938
|
+
// If self.tunnelOverride is set (the user specified a value), use it.
|
|
37939
|
+
if (typeof self.tunnelOverride !== 'undefined') {
|
|
37940
|
+
return self.tunnelOverride
|
|
37941
|
+
}
|
|
37963
37942
|
|
|
37964
|
-
|
|
37965
|
-
|
|
37943
|
+
// If the destination is HTTPS, tunnel.
|
|
37944
|
+
if (request.uri.protocol === 'https:') {
|
|
37945
|
+
return true
|
|
37946
|
+
}
|
|
37966
37947
|
|
|
37967
|
-
|
|
37968
|
-
|
|
37969
|
-
|
|
37948
|
+
// Otherwise, do not use tunnel.
|
|
37949
|
+
return false
|
|
37950
|
+
}
|
|
37970
37951
|
|
|
37971
|
-
|
|
37972
|
-
var
|
|
37952
|
+
Tunnel.prototype.setup = function (options) {
|
|
37953
|
+
var self = this
|
|
37954
|
+
var request = self.request
|
|
37973
37955
|
|
|
37974
|
-
|
|
37975
|
-
oa.oauth_signature_method,
|
|
37976
|
-
method,
|
|
37977
|
-
baseurl,
|
|
37978
|
-
params,
|
|
37979
|
-
consumer_secret_or_private_key, // eslint-disable-line camelcase
|
|
37980
|
-
token_secret // eslint-disable-line camelcase
|
|
37981
|
-
)
|
|
37956
|
+
options = options || {}
|
|
37982
37957
|
|
|
37983
|
-
if (
|
|
37984
|
-
|
|
37958
|
+
if (typeof request.proxy === 'string') {
|
|
37959
|
+
request.proxy = url.parse(request.proxy)
|
|
37985
37960
|
}
|
|
37986
37961
|
|
|
37987
|
-
|
|
37988
|
-
|
|
37989
|
-
|
|
37990
|
-
OAuth.prototype.buildBodyHash = function (_oauth, body) {
|
|
37991
|
-
if (['HMAC-SHA1', 'RSA-SHA1'].indexOf(_oauth.signature_method || 'HMAC-SHA1') < 0) {
|
|
37992
|
-
this.request.emit('error', new Error('oauth: ' + _oauth.signature_method +
|
|
37993
|
-
' signature_method not supported with body_hash signing.'))
|
|
37962
|
+
if (!request.proxy || !request.tunnel) {
|
|
37963
|
+
return false
|
|
37994
37964
|
}
|
|
37995
37965
|
|
|
37996
|
-
|
|
37997
|
-
|
|
37998
|
-
|
|
37966
|
+
// Setup Proxy Header Exclusive List and White List
|
|
37967
|
+
if (options.proxyHeaderWhiteList) {
|
|
37968
|
+
self.proxyHeaderWhiteList = options.proxyHeaderWhiteList
|
|
37969
|
+
}
|
|
37970
|
+
if (options.proxyHeaderExclusiveList) {
|
|
37971
|
+
self.proxyHeaderExclusiveList = options.proxyHeaderExclusiveList
|
|
37972
|
+
}
|
|
37999
37973
|
|
|
38000
|
-
|
|
38001
|
-
|
|
37974
|
+
var proxyHeaderExclusiveList = self.proxyHeaderExclusiveList.concat(defaultProxyHeaderExclusiveList)
|
|
37975
|
+
var proxyHeaderWhiteList = self.proxyHeaderWhiteList.concat(proxyHeaderExclusiveList)
|
|
38002
37976
|
|
|
38003
|
-
|
|
38004
|
-
|
|
37977
|
+
// Setup Proxy Headers and Proxy Headers Host
|
|
37978
|
+
// Only send the Proxy White Listed Header names
|
|
37979
|
+
var proxyHeaders = constructProxyHeaderWhiteList(request.headers, proxyHeaderWhiteList)
|
|
37980
|
+
proxyHeaders.host = constructProxyHost(request.uri)
|
|
38005
37981
|
|
|
38006
|
-
|
|
38007
|
-
return i !== 'realm' && i !== 'oauth_signature'
|
|
38008
|
-
}).sort()
|
|
37982
|
+
proxyHeaderExclusiveList.forEach(request.removeHeader, request)
|
|
38009
37983
|
|
|
38010
|
-
|
|
38011
|
-
|
|
38012
|
-
|
|
38013
|
-
|
|
37984
|
+
// Set Agent from Tunnel Data
|
|
37985
|
+
var tunnelFn = getTunnelFn(request)
|
|
37986
|
+
var tunnelOptions = constructTunnelOptions(request, proxyHeaders)
|
|
37987
|
+
request.agent = tunnelFn(tunnelOptions)
|
|
38014
37988
|
|
|
38015
|
-
return
|
|
38016
|
-
return i + '=' + wrap + oauth.rfc3986(oa[i]) + wrap
|
|
38017
|
-
}).join(sep)
|
|
37989
|
+
return true
|
|
38018
37990
|
}
|
|
38019
37991
|
|
|
38020
|
-
|
|
38021
|
-
|
|
38022
|
-
|
|
37992
|
+
Tunnel.defaultProxyHeaderWhiteList = defaultProxyHeaderWhiteList
|
|
37993
|
+
Tunnel.defaultProxyHeaderExclusiveList = defaultProxyHeaderExclusiveList
|
|
37994
|
+
exports.n = Tunnel
|
|
38023
37995
|
|
|
38024
|
-
var uri = self.request.uri || {}
|
|
38025
|
-
var method = self.request.method || ''
|
|
38026
|
-
var headers = caseless(self.request.headers)
|
|
38027
|
-
var body = self.request.body || ''
|
|
38028
|
-
var qsLib = self.request.qsLib || qs
|
|
38029
37996
|
|
|
38030
|
-
|
|
38031
|
-
var query
|
|
38032
|
-
var contentType = headers.get('content-type') || ''
|
|
38033
|
-
var formContentType = 'application/x-www-form-urlencoded'
|
|
38034
|
-
var transport = _oauth.transport_method || 'header'
|
|
37997
|
+
/***/ }),
|
|
38035
37998
|
|
|
38036
|
-
|
|
38037
|
-
|
|
38038
|
-
form = body
|
|
38039
|
-
}
|
|
38040
|
-
if (uri.query) {
|
|
38041
|
-
query = uri.query
|
|
38042
|
-
}
|
|
38043
|
-
if (transport === 'body' && (method !== 'POST' || contentType !== formContentType)) {
|
|
38044
|
-
self.request.emit('error', new Error('oauth: transport_method of body requires POST ' +
|
|
38045
|
-
'and content-type ' + formContentType))
|
|
38046
|
-
}
|
|
37999
|
+
/***/ 97501:
|
|
38000
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
38047
38001
|
|
|
38048
|
-
|
|
38049
|
-
|
|
38050
|
-
|
|
38002
|
+
var CombinedStream = __webpack_require__(74041);
|
|
38003
|
+
var util = __webpack_require__(31669);
|
|
38004
|
+
var path = __webpack_require__(85622);
|
|
38005
|
+
var http = __webpack_require__(98605);
|
|
38006
|
+
var https = __webpack_require__(57211);
|
|
38007
|
+
var parseUrl = __webpack_require__(78835).parse;
|
|
38008
|
+
var fs = __webpack_require__(35747);
|
|
38009
|
+
var mime = __webpack_require__(19010);
|
|
38010
|
+
var asynckit = __webpack_require__(48564);
|
|
38011
|
+
var populate = __webpack_require__(97631);
|
|
38051
38012
|
|
|
38052
|
-
|
|
38013
|
+
// Public API
|
|
38014
|
+
module.exports = FormData;
|
|
38053
38015
|
|
|
38054
|
-
|
|
38055
|
-
|
|
38056
|
-
self.request.setHeader('Authorization', 'OAuth ' + self.concatParams(oa, ',', '"'))
|
|
38057
|
-
break
|
|
38016
|
+
// make it a Stream
|
|
38017
|
+
util.inherits(FormData, CombinedStream);
|
|
38058
38018
|
|
|
38059
|
-
|
|
38060
|
-
|
|
38061
|
-
|
|
38062
|
-
|
|
38063
|
-
|
|
38019
|
+
/**
|
|
38020
|
+
* Create readable "multipart/form-data" streams.
|
|
38021
|
+
* Can be used to submit forms
|
|
38022
|
+
* and file uploads to other web applications.
|
|
38023
|
+
*
|
|
38024
|
+
* @constructor
|
|
38025
|
+
* @param {Object} options - Properties to be added/overriden for FormData and CombinedStream
|
|
38026
|
+
*/
|
|
38027
|
+
function FormData(options) {
|
|
38028
|
+
if (!(this instanceof FormData)) {
|
|
38029
|
+
return new FormData();
|
|
38030
|
+
}
|
|
38064
38031
|
|
|
38065
|
-
|
|
38066
|
-
|
|
38067
|
-
|
|
38032
|
+
this._overheadLength = 0;
|
|
38033
|
+
this._valueLength = 0;
|
|
38034
|
+
this._valuesToMeasure = [];
|
|
38068
38035
|
|
|
38069
|
-
|
|
38070
|
-
|
|
38036
|
+
CombinedStream.call(this);
|
|
38037
|
+
|
|
38038
|
+
options = options || {};
|
|
38039
|
+
for (var option in options) {
|
|
38040
|
+
this[option] = options[option];
|
|
38071
38041
|
}
|
|
38072
38042
|
}
|
|
38073
38043
|
|
|
38074
|
-
|
|
38044
|
+
FormData.LINE_BREAK = '\r\n';
|
|
38045
|
+
FormData.DEFAULT_CONTENT_TYPE = 'application/octet-stream';
|
|
38075
38046
|
|
|
38047
|
+
FormData.prototype.append = function(field, value, options) {
|
|
38076
38048
|
|
|
38077
|
-
|
|
38049
|
+
options = options || {};
|
|
38078
38050
|
|
|
38079
|
-
|
|
38080
|
-
|
|
38051
|
+
// allow filename as single option
|
|
38052
|
+
if (typeof options == 'string') {
|
|
38053
|
+
options = {filename: options};
|
|
38054
|
+
}
|
|
38081
38055
|
|
|
38082
|
-
|
|
38056
|
+
var append = CombinedStream.prototype.append.bind(this);
|
|
38083
38057
|
|
|
38058
|
+
// all that streamy business can't handle numbers
|
|
38059
|
+
if (typeof value == 'number') {
|
|
38060
|
+
value = '' + value;
|
|
38061
|
+
}
|
|
38084
38062
|
|
|
38085
|
-
|
|
38086
|
-
|
|
38063
|
+
// https://github.com/felixge/node-form-data/issues/38
|
|
38064
|
+
if (util.isArray(value)) {
|
|
38065
|
+
// Please convert your array into string
|
|
38066
|
+
// the way web server expects it
|
|
38067
|
+
this._error(new Error('Arrays are not supported.'));
|
|
38068
|
+
return;
|
|
38069
|
+
}
|
|
38087
38070
|
|
|
38088
|
-
|
|
38089
|
-
|
|
38090
|
-
this.lib = null
|
|
38091
|
-
this.useQuerystring = null
|
|
38092
|
-
this.parseOptions = null
|
|
38093
|
-
this.stringifyOptions = null
|
|
38094
|
-
}
|
|
38071
|
+
var header = this._multiPartHeader(field, value, options);
|
|
38072
|
+
var footer = this._multiPartFooter();
|
|
38095
38073
|
|
|
38096
|
-
|
|
38097
|
-
|
|
38074
|
+
append(header);
|
|
38075
|
+
append(value);
|
|
38076
|
+
append(footer);
|
|
38098
38077
|
|
|
38099
|
-
|
|
38100
|
-
this.
|
|
38078
|
+
// pass along options.knownLength
|
|
38079
|
+
this._trackLength(header, value, options);
|
|
38080
|
+
};
|
|
38101
38081
|
|
|
38102
|
-
|
|
38103
|
-
|
|
38104
|
-
}
|
|
38082
|
+
FormData.prototype._trackLength = function(header, value, options) {
|
|
38083
|
+
var valueLength = 0;
|
|
38105
38084
|
|
|
38106
|
-
|
|
38107
|
-
|
|
38108
|
-
|
|
38109
|
-
|
|
38110
|
-
|
|
38111
|
-
|
|
38112
|
-
|
|
38113
|
-
|
|
38085
|
+
// used w/ getLengthSync(), when length is known.
|
|
38086
|
+
// e.g. for streaming directly from a remote server,
|
|
38087
|
+
// w/ a known file a size, and not wanting to wait for
|
|
38088
|
+
// incoming file to finish to get its size.
|
|
38089
|
+
if (options.knownLength != null) {
|
|
38090
|
+
valueLength += +options.knownLength;
|
|
38091
|
+
} else if (Buffer.isBuffer(value)) {
|
|
38092
|
+
valueLength = value.length;
|
|
38093
|
+
} else if (typeof value === 'string') {
|
|
38094
|
+
valueLength = Buffer.byteLength(value);
|
|
38095
|
+
}
|
|
38114
38096
|
|
|
38115
|
-
|
|
38116
|
-
return (this.useQuerystring)
|
|
38117
|
-
? this.lib.parse(str,
|
|
38118
|
-
this.parseOptions.sep || null,
|
|
38119
|
-
this.parseOptions.eq || null,
|
|
38120
|
-
this.parseOptions)
|
|
38121
|
-
: this.lib.parse(str, this.parseOptions)
|
|
38122
|
-
}
|
|
38097
|
+
this._valueLength += valueLength;
|
|
38123
38098
|
|
|
38124
|
-
|
|
38125
|
-
|
|
38126
|
-
|
|
38127
|
-
|
|
38128
|
-
}
|
|
38099
|
+
// @check why add CRLF? does this account for custom/multiple CRLFs?
|
|
38100
|
+
this._overheadLength +=
|
|
38101
|
+
Buffer.byteLength(header) +
|
|
38102
|
+
FormData.LINE_BREAK.length;
|
|
38129
38103
|
|
|
38130
|
-
|
|
38104
|
+
// empty or either doesn't have path or not an http response
|
|
38105
|
+
if (!value || ( !value.path && !(value.readable && value.hasOwnProperty('httpVersion')) )) {
|
|
38106
|
+
return;
|
|
38107
|
+
}
|
|
38131
38108
|
|
|
38132
|
-
|
|
38109
|
+
// no need to bother with the length
|
|
38110
|
+
if (!options.knownLength) {
|
|
38111
|
+
this._valuesToMeasure.push(value);
|
|
38112
|
+
}
|
|
38113
|
+
};
|
|
38133
38114
|
|
|
38115
|
+
FormData.prototype._lengthRetriever = function(value, callback) {
|
|
38134
38116
|
|
|
38135
|
-
|
|
38117
|
+
if (value.hasOwnProperty('fd')) {
|
|
38136
38118
|
|
|
38137
|
-
|
|
38138
|
-
|
|
38119
|
+
// take read range into a account
|
|
38120
|
+
// `end` = Infinity –> read file till the end
|
|
38121
|
+
//
|
|
38122
|
+
// TODO: Looks like there is bug in Node fs.createReadStream
|
|
38123
|
+
// it doesn't respect `end` options without `start` options
|
|
38124
|
+
// Fix it when node fixes it.
|
|
38125
|
+
// https://github.com/joyent/node/issues/7819
|
|
38126
|
+
if (value.end != undefined && value.end != Infinity && value.start != undefined) {
|
|
38139
38127
|
|
|
38140
|
-
|
|
38128
|
+
// when end specified
|
|
38129
|
+
// no need to calculate range
|
|
38130
|
+
// inclusive, starts with 0
|
|
38131
|
+
callback(null, value.end + 1 - (value.start ? value.start : 0));
|
|
38141
38132
|
|
|
38133
|
+
// not that fast snoopy
|
|
38134
|
+
} else {
|
|
38135
|
+
// still need to fetch file size from fs
|
|
38136
|
+
fs.stat(value.path, function(err, stat) {
|
|
38142
38137
|
|
|
38143
|
-
var
|
|
38144
|
-
var isUrl = /^https?:/
|
|
38138
|
+
var fileSize;
|
|
38145
38139
|
|
|
38146
|
-
|
|
38147
|
-
|
|
38148
|
-
|
|
38149
|
-
|
|
38150
|
-
this.followAllRedirects = false
|
|
38151
|
-
this.followOriginalHttpMethod = false
|
|
38152
|
-
this.allowRedirect = function () { return true }
|
|
38153
|
-
this.maxRedirects = 10
|
|
38154
|
-
this.redirects = []
|
|
38155
|
-
this.redirectsFollowed = 0
|
|
38156
|
-
this.removeRefererHeader = false
|
|
38157
|
-
}
|
|
38140
|
+
if (err) {
|
|
38141
|
+
callback(err);
|
|
38142
|
+
return;
|
|
38143
|
+
}
|
|
38158
38144
|
|
|
38159
|
-
|
|
38160
|
-
|
|
38145
|
+
// update final size based on the range options
|
|
38146
|
+
fileSize = stat.size - (value.start ? value.start : 0);
|
|
38147
|
+
callback(null, fileSize);
|
|
38148
|
+
});
|
|
38149
|
+
}
|
|
38161
38150
|
|
|
38162
|
-
|
|
38163
|
-
|
|
38164
|
-
|
|
38165
|
-
|
|
38166
|
-
|
|
38167
|
-
}
|
|
38168
|
-
|
|
38169
|
-
|
|
38170
|
-
|
|
38171
|
-
|
|
38172
|
-
|
|
38173
|
-
|
|
38174
|
-
|
|
38175
|
-
|
|
38176
|
-
}
|
|
38177
|
-
|
|
38178
|
-
self.removeRefererHeader = options.removeRefererHeader
|
|
38151
|
+
// or http response
|
|
38152
|
+
} else if (value.hasOwnProperty('httpVersion')) {
|
|
38153
|
+
callback(null, +value.headers['content-length']);
|
|
38154
|
+
|
|
38155
|
+
// or request stream http://github.com/mikeal/request
|
|
38156
|
+
} else if (value.hasOwnProperty('httpModule')) {
|
|
38157
|
+
// wait till response come back
|
|
38158
|
+
value.on('response', function(response) {
|
|
38159
|
+
value.pause();
|
|
38160
|
+
callback(null, +response.headers['content-length']);
|
|
38161
|
+
});
|
|
38162
|
+
value.resume();
|
|
38163
|
+
|
|
38164
|
+
// something else
|
|
38165
|
+
} else {
|
|
38166
|
+
callback('Unknown stream');
|
|
38179
38167
|
}
|
|
38180
|
-
|
|
38181
|
-
|
|
38168
|
+
};
|
|
38169
|
+
|
|
38170
|
+
FormData.prototype._multiPartHeader = function(field, value, options) {
|
|
38171
|
+
// custom header specified (as string)?
|
|
38172
|
+
// it becomes responsible for boundary
|
|
38173
|
+
// (e.g. to handle extra CRLFs on .NET servers)
|
|
38174
|
+
if (typeof options.header == 'string') {
|
|
38175
|
+
return options.header;
|
|
38182
38176
|
}
|
|
38183
|
-
}
|
|
38184
38177
|
|
|
38185
|
-
|
|
38186
|
-
var
|
|
38187
|
-
var request = self.request
|
|
38178
|
+
var contentDisposition = this._getContentDisposition(value, options);
|
|
38179
|
+
var contentType = this._getContentType(value, options);
|
|
38188
38180
|
|
|
38189
|
-
var
|
|
38190
|
-
|
|
38191
|
-
|
|
38192
|
-
|
|
38181
|
+
var contents = '';
|
|
38182
|
+
var headers = {
|
|
38183
|
+
// add custom disposition as third element or keep it two elements if not
|
|
38184
|
+
'Content-Disposition': ['form-data', 'name="' + field + '"'].concat(contentDisposition || []),
|
|
38185
|
+
// if no content type. allow it to be empty array
|
|
38186
|
+
'Content-Type': [].concat(contentType || [])
|
|
38187
|
+
};
|
|
38193
38188
|
|
|
38194
|
-
|
|
38195
|
-
|
|
38196
|
-
|
|
38197
|
-
|
|
38198
|
-
|
|
38199
|
-
|
|
38200
|
-
|
|
38201
|
-
|
|
38202
|
-
|
|
38203
|
-
|
|
38204
|
-
|
|
38205
|
-
|
|
38206
|
-
|
|
38207
|
-
}
|
|
38189
|
+
// allow custom headers.
|
|
38190
|
+
if (typeof options.header == 'object') {
|
|
38191
|
+
populate(headers, options.header);
|
|
38192
|
+
}
|
|
38193
|
+
|
|
38194
|
+
var header;
|
|
38195
|
+
for (var prop in headers) {
|
|
38196
|
+
if (!headers.hasOwnProperty(prop)) continue;
|
|
38197
|
+
header = headers[prop];
|
|
38198
|
+
|
|
38199
|
+
// skip nullish headers.
|
|
38200
|
+
if (header == null) {
|
|
38201
|
+
continue;
|
|
38208
38202
|
}
|
|
38209
|
-
|
|
38210
|
-
|
|
38211
|
-
if (
|
|
38212
|
-
|
|
38213
|
-
|
|
38203
|
+
|
|
38204
|
+
// convert all headers to arrays.
|
|
38205
|
+
if (!Array.isArray(header)) {
|
|
38206
|
+
header = [header];
|
|
38207
|
+
}
|
|
38208
|
+
|
|
38209
|
+
// add non-empty headers.
|
|
38210
|
+
if (header.length) {
|
|
38211
|
+
contents += prop + ': ' + header.join('; ') + FormData.LINE_BREAK;
|
|
38214
38212
|
}
|
|
38215
38213
|
}
|
|
38216
|
-
return redirectTo
|
|
38217
|
-
}
|
|
38218
38214
|
|
|
38219
|
-
|
|
38220
|
-
|
|
38221
|
-
var request = self.request
|
|
38215
|
+
return '--' + this.getBoundary() + FormData.LINE_BREAK + contents + FormData.LINE_BREAK;
|
|
38216
|
+
};
|
|
38222
38217
|
|
|
38223
|
-
|
|
38224
|
-
if (!redirectTo || !self.allowRedirect.call(request, response)) {
|
|
38225
|
-
return false
|
|
38226
|
-
}
|
|
38218
|
+
FormData.prototype._getContentDisposition = function(value, options) {
|
|
38227
38219
|
|
|
38228
|
-
|
|
38220
|
+
var filename
|
|
38221
|
+
, contentDisposition
|
|
38222
|
+
;
|
|
38229
38223
|
|
|
38230
|
-
|
|
38231
|
-
|
|
38232
|
-
|
|
38233
|
-
if (
|
|
38234
|
-
|
|
38224
|
+
if (typeof options.filepath === 'string') {
|
|
38225
|
+
// custom filepath for relative paths
|
|
38226
|
+
filename = path.normalize(options.filepath).replace(/\\/g, '/');
|
|
38227
|
+
} else if (options.filename || value.name || value.path) {
|
|
38228
|
+
// custom filename take precedence
|
|
38229
|
+
// formidable and the browser add a name property
|
|
38230
|
+
// fs- and request- streams have path property
|
|
38231
|
+
filename = path.basename(options.filename || value.name || value.path);
|
|
38232
|
+
} else if (value.readable && value.hasOwnProperty('httpVersion')) {
|
|
38233
|
+
// or try http response
|
|
38234
|
+
filename = path.basename(value.client._httpMessage.path);
|
|
38235
38235
|
}
|
|
38236
38236
|
|
|
38237
|
-
if (
|
|
38238
|
-
|
|
38239
|
-
return false
|
|
38237
|
+
if (filename) {
|
|
38238
|
+
contentDisposition = 'filename="' + filename + '"';
|
|
38240
38239
|
}
|
|
38241
|
-
self.redirectsFollowed += 1
|
|
38242
38240
|
|
|
38243
|
-
|
|
38244
|
-
|
|
38245
|
-
}
|
|
38241
|
+
return contentDisposition;
|
|
38242
|
+
};
|
|
38246
38243
|
|
|
38247
|
-
|
|
38248
|
-
request.uri = url.parse(redirectTo)
|
|
38244
|
+
FormData.prototype._getContentType = function(value, options) {
|
|
38249
38245
|
|
|
38250
|
-
//
|
|
38251
|
-
|
|
38252
|
-
|
|
38246
|
+
// use custom content-type above all
|
|
38247
|
+
var contentType = options.contentType;
|
|
38248
|
+
|
|
38249
|
+
// or try `name` from formidable, browser
|
|
38250
|
+
if (!contentType && value.name) {
|
|
38251
|
+
contentType = mime.lookup(value.name);
|
|
38253
38252
|
}
|
|
38254
38253
|
|
|
38255
|
-
|
|
38254
|
+
// or try `path` from fs-, request- streams
|
|
38255
|
+
if (!contentType && value.path) {
|
|
38256
|
+
contentType = mime.lookup(value.path);
|
|
38257
|
+
}
|
|
38256
38258
|
|
|
38257
|
-
|
|
38258
|
-
|
|
38259
|
-
|
|
38259
|
+
// or if it's http-reponse
|
|
38260
|
+
if (!contentType && value.readable && value.hasOwnProperty('httpVersion')) {
|
|
38261
|
+
contentType = value.headers['content-type'];
|
|
38260
38262
|
}
|
|
38261
|
-
|
|
38262
|
-
|
|
38263
|
-
|
|
38264
|
-
|
|
38265
|
-
if (response.statusCode !== 401 && response.statusCode !== 307) {
|
|
38266
|
-
// Remove parameters from the previous response, unless this is the second request
|
|
38267
|
-
// for a server that requires digest authentication.
|
|
38268
|
-
delete request.body
|
|
38269
|
-
delete request._form
|
|
38270
|
-
if (request.headers) {
|
|
38271
|
-
request.removeHeader('host')
|
|
38272
|
-
request.removeHeader('content-type')
|
|
38273
|
-
request.removeHeader('content-length')
|
|
38274
|
-
if (request.uri.hostname !== request.originalHost.split(':')[0]) {
|
|
38275
|
-
// Remove authorization if changing hostnames (but not if just
|
|
38276
|
-
// changing ports or protocols). This matches the behavior of curl:
|
|
38277
|
-
// https://github.com/bagder/curl/blob/6beb0eee/lib/http.c#L710
|
|
38278
|
-
request.removeHeader('authorization')
|
|
38279
|
-
}
|
|
38280
|
-
}
|
|
38263
|
+
|
|
38264
|
+
// or guess it from the filepath or filename
|
|
38265
|
+
if (!contentType && (options.filepath || options.filename)) {
|
|
38266
|
+
contentType = mime.lookup(options.filepath || options.filename);
|
|
38281
38267
|
}
|
|
38282
38268
|
|
|
38283
|
-
if
|
|
38284
|
-
|
|
38269
|
+
// fallback to the default content type if `value` is not simple value
|
|
38270
|
+
if (!contentType && typeof value == 'object') {
|
|
38271
|
+
contentType = FormData.DEFAULT_CONTENT_TYPE;
|
|
38285
38272
|
}
|
|
38286
38273
|
|
|
38287
|
-
|
|
38274
|
+
return contentType;
|
|
38275
|
+
};
|
|
38288
38276
|
|
|
38289
|
-
|
|
38277
|
+
FormData.prototype._multiPartFooter = function() {
|
|
38278
|
+
return function(next) {
|
|
38279
|
+
var footer = FormData.LINE_BREAK;
|
|
38290
38280
|
|
|
38291
|
-
|
|
38292
|
-
|
|
38281
|
+
var lastPart = (this._streams.length === 0);
|
|
38282
|
+
if (lastPart) {
|
|
38283
|
+
footer += this._lastBoundary();
|
|
38284
|
+
}
|
|
38293
38285
|
|
|
38294
|
-
|
|
38286
|
+
next(footer);
|
|
38287
|
+
}.bind(this);
|
|
38288
|
+
};
|
|
38295
38289
|
|
|
38290
|
+
FormData.prototype._lastBoundary = function() {
|
|
38291
|
+
return '--' + this.getBoundary() + '--' + FormData.LINE_BREAK;
|
|
38292
|
+
};
|
|
38296
38293
|
|
|
38297
|
-
|
|
38294
|
+
FormData.prototype.getHeaders = function(userHeaders) {
|
|
38295
|
+
var header;
|
|
38296
|
+
var formHeaders = {
|
|
38297
|
+
'content-type': 'multipart/form-data; boundary=' + this.getBoundary()
|
|
38298
|
+
};
|
|
38298
38299
|
|
|
38299
|
-
|
|
38300
|
-
|
|
38300
|
+
for (header in userHeaders) {
|
|
38301
|
+
if (userHeaders.hasOwnProperty(header)) {
|
|
38302
|
+
formHeaders[header.toLowerCase()] = userHeaders[header];
|
|
38303
|
+
}
|
|
38304
|
+
}
|
|
38301
38305
|
|
|
38302
|
-
|
|
38306
|
+
return formHeaders;
|
|
38307
|
+
};
|
|
38303
38308
|
|
|
38309
|
+
FormData.prototype.getBoundary = function() {
|
|
38310
|
+
if (!this._boundary) {
|
|
38311
|
+
this._generateBoundary();
|
|
38312
|
+
}
|
|
38304
38313
|
|
|
38305
|
-
|
|
38306
|
-
|
|
38314
|
+
return this._boundary;
|
|
38315
|
+
};
|
|
38307
38316
|
|
|
38308
|
-
|
|
38309
|
-
|
|
38310
|
-
|
|
38311
|
-
'
|
|
38312
|
-
|
|
38313
|
-
|
|
38314
|
-
|
|
38315
|
-
'content-encoding',
|
|
38316
|
-
'content-language',
|
|
38317
|
-
'content-location',
|
|
38318
|
-
'content-md5',
|
|
38319
|
-
'content-range',
|
|
38320
|
-
'content-type',
|
|
38321
|
-
'connection',
|
|
38322
|
-
'date',
|
|
38323
|
-
'expect',
|
|
38324
|
-
'max-forwards',
|
|
38325
|
-
'pragma',
|
|
38326
|
-
'referer',
|
|
38327
|
-
'te',
|
|
38328
|
-
'user-agent',
|
|
38329
|
-
'via'
|
|
38330
|
-
]
|
|
38317
|
+
FormData.prototype._generateBoundary = function() {
|
|
38318
|
+
// This generates a 50 character boundary similar to those used by Firefox.
|
|
38319
|
+
// They are optimized for boyer-moore parsing.
|
|
38320
|
+
var boundary = '--------------------------';
|
|
38321
|
+
for (var i = 0; i < 24; i++) {
|
|
38322
|
+
boundary += Math.floor(Math.random() * 10).toString(16);
|
|
38323
|
+
}
|
|
38331
38324
|
|
|
38332
|
-
|
|
38333
|
-
|
|
38334
|
-
]
|
|
38325
|
+
this._boundary = boundary;
|
|
38326
|
+
};
|
|
38335
38327
|
|
|
38336
|
-
|
|
38337
|
-
|
|
38338
|
-
|
|
38339
|
-
|
|
38328
|
+
// Note: getLengthSync DOESN'T calculate streams length
|
|
38329
|
+
// As workaround one can calculate file size manually
|
|
38330
|
+
// and add it as knownLength option
|
|
38331
|
+
FormData.prototype.getLengthSync = function() {
|
|
38332
|
+
var knownLength = this._overheadLength + this._valueLength;
|
|
38340
38333
|
|
|
38341
|
-
|
|
38342
|
-
|
|
38343
|
-
|
|
38344
|
-
|
|
38345
|
-
} else {
|
|
38346
|
-
proxyHost += '80'
|
|
38334
|
+
// Don't get confused, there are 3 "internal" streams for each keyval pair
|
|
38335
|
+
// so it basically checks if there is any value added to the form
|
|
38336
|
+
if (this._streams.length) {
|
|
38337
|
+
knownLength += this._lastBoundary().length;
|
|
38347
38338
|
}
|
|
38348
38339
|
|
|
38349
|
-
|
|
38350
|
-
|
|
38340
|
+
// https://github.com/form-data/form-data/issues/40
|
|
38341
|
+
if (!this.hasKnownLength()) {
|
|
38342
|
+
// Some async length retrievers are present
|
|
38343
|
+
// therefore synchronous length calculation is false.
|
|
38344
|
+
// Please use getLength(callback) to get proper length
|
|
38345
|
+
this._error(new Error('Cannot calculate proper length in synchronous way.'));
|
|
38346
|
+
}
|
|
38351
38347
|
|
|
38352
|
-
|
|
38353
|
-
|
|
38354
|
-
.reduce(function (set, header) {
|
|
38355
|
-
set[header.toLowerCase()] = true
|
|
38356
|
-
return set
|
|
38357
|
-
}, {})
|
|
38348
|
+
return knownLength;
|
|
38349
|
+
};
|
|
38358
38350
|
|
|
38359
|
-
|
|
38360
|
-
|
|
38361
|
-
|
|
38362
|
-
|
|
38363
|
-
|
|
38364
|
-
set[header] = headers[header]
|
|
38365
|
-
return set
|
|
38366
|
-
}, {})
|
|
38367
|
-
}
|
|
38351
|
+
// Public API to check if length of added values is known
|
|
38352
|
+
// https://github.com/form-data/form-data/issues/196
|
|
38353
|
+
// https://github.com/form-data/form-data/issues/262
|
|
38354
|
+
FormData.prototype.hasKnownLength = function() {
|
|
38355
|
+
var hasKnownLength = true;
|
|
38368
38356
|
|
|
38369
|
-
|
|
38370
|
-
|
|
38357
|
+
if (this._valuesToMeasure.length) {
|
|
38358
|
+
hasKnownLength = false;
|
|
38359
|
+
}
|
|
38371
38360
|
|
|
38372
|
-
|
|
38373
|
-
|
|
38374
|
-
|
|
38375
|
-
|
|
38376
|
-
|
|
38377
|
-
|
|
38378
|
-
|
|
38379
|
-
|
|
38380
|
-
ca: request.ca,
|
|
38381
|
-
cert: request.cert,
|
|
38382
|
-
key: request.key,
|
|
38383
|
-
passphrase: request.passphrase,
|
|
38384
|
-
pfx: request.pfx,
|
|
38385
|
-
ciphers: request.ciphers,
|
|
38386
|
-
rejectUnauthorized: request.rejectUnauthorized,
|
|
38387
|
-
secureOptions: request.secureOptions,
|
|
38388
|
-
secureProtocol: request.secureProtocol
|
|
38361
|
+
return hasKnownLength;
|
|
38362
|
+
};
|
|
38363
|
+
|
|
38364
|
+
FormData.prototype.getLength = function(cb) {
|
|
38365
|
+
var knownLength = this._overheadLength + this._valueLength;
|
|
38366
|
+
|
|
38367
|
+
if (this._streams.length) {
|
|
38368
|
+
knownLength += this._lastBoundary().length;
|
|
38389
38369
|
}
|
|
38390
38370
|
|
|
38391
|
-
|
|
38392
|
-
|
|
38371
|
+
if (!this._valuesToMeasure.length) {
|
|
38372
|
+
process.nextTick(cb.bind(this, null, knownLength));
|
|
38373
|
+
return;
|
|
38374
|
+
}
|
|
38393
38375
|
|
|
38394
|
-
|
|
38395
|
-
|
|
38396
|
-
|
|
38397
|
-
|
|
38398
|
-
}
|
|
38376
|
+
asynckit.parallel(this._valuesToMeasure, this._lengthRetriever, function(err, values) {
|
|
38377
|
+
if (err) {
|
|
38378
|
+
cb(err);
|
|
38379
|
+
return;
|
|
38380
|
+
}
|
|
38399
38381
|
|
|
38400
|
-
function
|
|
38401
|
-
|
|
38402
|
-
|
|
38403
|
-
var tunnelFnName = constructTunnelFnName(uri, proxy)
|
|
38404
|
-
return tunnel[tunnelFnName]
|
|
38405
|
-
}
|
|
38382
|
+
values.forEach(function(length) {
|
|
38383
|
+
knownLength += length;
|
|
38384
|
+
});
|
|
38406
38385
|
|
|
38407
|
-
|
|
38408
|
-
|
|
38409
|
-
|
|
38410
|
-
this.proxyHeaderExclusiveList = []
|
|
38411
|
-
if (typeof request.tunnel !== 'undefined') {
|
|
38412
|
-
this.tunnelOverride = request.tunnel
|
|
38413
|
-
}
|
|
38414
|
-
}
|
|
38386
|
+
cb(null, knownLength);
|
|
38387
|
+
});
|
|
38388
|
+
};
|
|
38415
38389
|
|
|
38416
|
-
|
|
38417
|
-
var
|
|
38418
|
-
|
|
38419
|
-
|
|
38390
|
+
FormData.prototype.submit = function(params, cb) {
|
|
38391
|
+
var request
|
|
38392
|
+
, options
|
|
38393
|
+
, defaults = {method: 'post'}
|
|
38394
|
+
;
|
|
38420
38395
|
|
|
38421
|
-
//
|
|
38422
|
-
|
|
38423
|
-
|
|
38396
|
+
// parse provided url if it's string
|
|
38397
|
+
// or treat it as options object
|
|
38398
|
+
if (typeof params == 'string') {
|
|
38399
|
+
|
|
38400
|
+
params = parseUrl(params);
|
|
38401
|
+
options = populate({
|
|
38402
|
+
port: params.port,
|
|
38403
|
+
path: params.pathname,
|
|
38404
|
+
host: params.hostname,
|
|
38405
|
+
protocol: params.protocol
|
|
38406
|
+
}, defaults);
|
|
38407
|
+
|
|
38408
|
+
// use custom params
|
|
38409
|
+
} else {
|
|
38410
|
+
|
|
38411
|
+
options = populate(params, defaults);
|
|
38412
|
+
// if no port provided use default one
|
|
38413
|
+
if (!options.port) {
|
|
38414
|
+
options.port = options.protocol == 'https:' ? 443 : 80;
|
|
38415
|
+
}
|
|
38424
38416
|
}
|
|
38425
38417
|
|
|
38426
|
-
//
|
|
38427
|
-
|
|
38428
|
-
|
|
38418
|
+
// put that good code in getHeaders to some use
|
|
38419
|
+
options.headers = this.getHeaders(params.headers);
|
|
38420
|
+
|
|
38421
|
+
// https if specified, fallback to http in any other case
|
|
38422
|
+
if (options.protocol == 'https:') {
|
|
38423
|
+
request = https.request(options);
|
|
38424
|
+
} else {
|
|
38425
|
+
request = http.request(options);
|
|
38429
38426
|
}
|
|
38430
38427
|
|
|
38431
|
-
//
|
|
38432
|
-
|
|
38433
|
-
|
|
38428
|
+
// get content length and fire away
|
|
38429
|
+
this.getLength(function(err, length) {
|
|
38430
|
+
if (err) {
|
|
38431
|
+
this._error(err);
|
|
38432
|
+
return;
|
|
38433
|
+
}
|
|
38434
38434
|
|
|
38435
|
-
|
|
38436
|
-
|
|
38437
|
-
var request = self.request
|
|
38435
|
+
// add content length
|
|
38436
|
+
request.setHeader('Content-Length', length);
|
|
38438
38437
|
|
|
38439
|
-
|
|
38438
|
+
this.pipe(request);
|
|
38439
|
+
if (cb) {
|
|
38440
|
+
request.on('error', cb);
|
|
38441
|
+
request.on('response', cb.bind(this, null));
|
|
38442
|
+
}
|
|
38443
|
+
}.bind(this));
|
|
38440
38444
|
|
|
38441
|
-
|
|
38442
|
-
|
|
38443
|
-
}
|
|
38445
|
+
return request;
|
|
38446
|
+
};
|
|
38444
38447
|
|
|
38445
|
-
|
|
38446
|
-
|
|
38448
|
+
FormData.prototype._error = function(err) {
|
|
38449
|
+
if (!this.error) {
|
|
38450
|
+
this.error = err;
|
|
38451
|
+
this.pause();
|
|
38452
|
+
this.emit('error', err);
|
|
38447
38453
|
}
|
|
38454
|
+
};
|
|
38448
38455
|
|
|
38449
|
-
|
|
38450
|
-
|
|
38451
|
-
|
|
38452
|
-
}
|
|
38453
|
-
if (options.proxyHeaderExclusiveList) {
|
|
38454
|
-
self.proxyHeaderExclusiveList = options.proxyHeaderExclusiveList
|
|
38455
|
-
}
|
|
38456
|
+
FormData.prototype.toString = function () {
|
|
38457
|
+
return '[object FormData]';
|
|
38458
|
+
};
|
|
38456
38459
|
|
|
38457
|
-
var proxyHeaderExclusiveList = self.proxyHeaderExclusiveList.concat(defaultProxyHeaderExclusiveList)
|
|
38458
|
-
var proxyHeaderWhiteList = self.proxyHeaderWhiteList.concat(proxyHeaderExclusiveList)
|
|
38459
38460
|
|
|
38460
|
-
|
|
38461
|
-
// Only send the Proxy White Listed Header names
|
|
38462
|
-
var proxyHeaders = constructProxyHeaderWhiteList(request.headers, proxyHeaderWhiteList)
|
|
38463
|
-
proxyHeaders.host = constructProxyHost(request.uri)
|
|
38461
|
+
/***/ }),
|
|
38464
38462
|
|
|
38465
|
-
|
|
38463
|
+
/***/ 97631:
|
|
38464
|
+
/***/ ((module) => {
|
|
38466
38465
|
|
|
38467
|
-
|
|
38468
|
-
|
|
38469
|
-
var tunnelOptions = constructTunnelOptions(request, proxyHeaders)
|
|
38470
|
-
request.agent = tunnelFn(tunnelOptions)
|
|
38466
|
+
// populates missing values
|
|
38467
|
+
module.exports = function(dst, src) {
|
|
38471
38468
|
|
|
38472
|
-
|
|
38473
|
-
|
|
38469
|
+
Object.keys(src).forEach(function(prop)
|
|
38470
|
+
{
|
|
38471
|
+
dst[prop] = dst[prop] || src[prop];
|
|
38472
|
+
});
|
|
38474
38473
|
|
|
38475
|
-
|
|
38476
|
-
|
|
38477
|
-
exports.n = Tunnel
|
|
38474
|
+
return dst;
|
|
38475
|
+
};
|
|
38478
38476
|
|
|
38479
38477
|
|
|
38480
38478
|
/***/ }),
|
|
@@ -39163,7 +39161,7 @@ var httpSignature = __webpack_require__(31689)
|
|
|
39163
39161
|
var mime = __webpack_require__(19010)
|
|
39164
39162
|
var caseless = __webpack_require__(72464)
|
|
39165
39163
|
var ForeverAgent = __webpack_require__(68880)
|
|
39166
|
-
var FormData = __webpack_require__(
|
|
39164
|
+
var FormData = __webpack_require__(97501)
|
|
39167
39165
|
var extend = __webpack_require__(51302)
|
|
39168
39166
|
var isstream = __webpack_require__(92104)
|
|
39169
39167
|
var isTypedArray = __webpack_require__(27721).strict
|
|
@@ -55203,6 +55201,309 @@ const ansiRegex = __webpack_require__(36403);
|
|
|
55203
55201
|
module.exports = input => typeof input === 'string' ? input.replace(ansiRegex(), '') : input;
|
|
55204
55202
|
|
|
55205
55203
|
|
|
55204
|
+
/***/ }),
|
|
55205
|
+
|
|
55206
|
+
/***/ 4585:
|
|
55207
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
55208
|
+
|
|
55209
|
+
"use strict";
|
|
55210
|
+
|
|
55211
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
55212
|
+
var FioriElementsVersion;
|
|
55213
|
+
(function (FioriElementsVersion) {
|
|
55214
|
+
FioriElementsVersion["v2"] = "v2";
|
|
55215
|
+
FioriElementsVersion["v4"] = "v4";
|
|
55216
|
+
})(FioriElementsVersion = exports.FioriElementsVersion || (exports.FioriElementsVersion = {}));
|
|
55217
|
+
var OdataVersion;
|
|
55218
|
+
(function (OdataVersion) {
|
|
55219
|
+
OdataVersion["v2"] = "v2";
|
|
55220
|
+
OdataVersion["v4"] = "v4";
|
|
55221
|
+
})(OdataVersion = exports.OdataVersion || (exports.OdataVersion = {}));
|
|
55222
|
+
var PageHeaderType;
|
|
55223
|
+
(function (PageHeaderType) {
|
|
55224
|
+
PageHeaderType["Dynamic"] = "Dynamic";
|
|
55225
|
+
})(PageHeaderType = exports.PageHeaderType || (exports.PageHeaderType = {}));
|
|
55226
|
+
var RootIntent;
|
|
55227
|
+
(function (RootIntent) {
|
|
55228
|
+
RootIntent["listReportV2"] = "masterDetail-display";
|
|
55229
|
+
RootIntent["listReportV4"] = "fe-lrop-v4";
|
|
55230
|
+
RootIntent["ovp"] = "OVP-display";
|
|
55231
|
+
})(RootIntent = exports.RootIntent || (exports.RootIntent = {}));
|
|
55232
|
+
var AppType;
|
|
55233
|
+
(function (AppType) {
|
|
55234
|
+
AppType["FioriElement"] = "SAP Fiori elements";
|
|
55235
|
+
AppType["UI5Freestyle"] = "SAPUI5 freestyle";
|
|
55236
|
+
})(AppType = exports.AppType || (exports.AppType = {}));
|
|
55237
|
+
|
|
55238
|
+
|
|
55239
|
+
/***/ }),
|
|
55240
|
+
|
|
55241
|
+
/***/ 69681:
|
|
55242
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
55243
|
+
|
|
55244
|
+
"use strict";
|
|
55245
|
+
|
|
55246
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
55247
|
+
const os_1 = __webpack_require__(12087);
|
|
55248
|
+
const path_1 = __webpack_require__(85622);
|
|
55249
|
+
var DirName;
|
|
55250
|
+
(function (DirName) {
|
|
55251
|
+
DirName["Sapux"] = "src";
|
|
55252
|
+
DirName["Schemas"] = ".schemas";
|
|
55253
|
+
DirName["Pages"] = "pages";
|
|
55254
|
+
DirName["Webapp"] = "webapp";
|
|
55255
|
+
DirName["Temp"] = ".tmp";
|
|
55256
|
+
DirName["Changes"] = "changes";
|
|
55257
|
+
DirName["LocalService"] = "localService";
|
|
55258
|
+
DirName["Controller"] = "controller";
|
|
55259
|
+
DirName["View"] = "view";
|
|
55260
|
+
DirName["Fragment"] = "fragment";
|
|
55261
|
+
DirName["Ext"] = "ext";
|
|
55262
|
+
DirName["VSCode"] = ".vscode";
|
|
55263
|
+
DirName["AppConfig"] = "appconfig";
|
|
55264
|
+
DirName["Db"] = "db";
|
|
55265
|
+
DirName["Csv"] = "csv";
|
|
55266
|
+
DirName["Data"] = "data";
|
|
55267
|
+
DirName["Mockdata"] = "mockdata";
|
|
55268
|
+
})(DirName = exports.DirName || (exports.DirName = {}));
|
|
55269
|
+
var FileName;
|
|
55270
|
+
(function (FileName) {
|
|
55271
|
+
FileName["Manifest"] = "manifest.json";
|
|
55272
|
+
FileName["App"] = "app.json";
|
|
55273
|
+
FileName["Package"] = "package.json";
|
|
55274
|
+
FileName["ServiceMetadata"] = "metadata.xml";
|
|
55275
|
+
FileName["NeoApp"] = "neo-app.json";
|
|
55276
|
+
FileName["Pom"] = "pom.xml";
|
|
55277
|
+
FileName["Fragment"] = "fragment.xml";
|
|
55278
|
+
FileName["LaunchConfig"] = "launch.json";
|
|
55279
|
+
FileName["ServiceCds"] = "services.cds";
|
|
55280
|
+
FileName["IndexCds"] = "index.cds";
|
|
55281
|
+
FileName["Ui5Yaml"] = "ui5.yaml";
|
|
55282
|
+
FileName["Ui5LocalYaml"] = "ui5-local.yaml";
|
|
55283
|
+
FileName["Ui5MockYaml"] = "ui5-mock.yaml";
|
|
55284
|
+
FileName["fioriSandboxConfig"] = "fioriSandboxConfig.json";
|
|
55285
|
+
FileName["View"] = "view.xml";
|
|
55286
|
+
})(FileName = exports.FileName || (exports.FileName = {}));
|
|
55287
|
+
var FioriToolsSettings;
|
|
55288
|
+
(function (FioriToolsSettings) {
|
|
55289
|
+
FioriToolsSettings["dir"] = ".fioritools";
|
|
55290
|
+
FioriToolsSettings["migrationSettingsFile"] = "migrationSettings.json";
|
|
55291
|
+
})(FioriToolsSettings = exports.FioriToolsSettings || (exports.FioriToolsSettings = {}));
|
|
55292
|
+
exports.getFioriToolsDirectory = () => {
|
|
55293
|
+
return path_1.join(os_1.homedir(), FioriToolsSettings.dir);
|
|
55294
|
+
};
|
|
55295
|
+
var SchemeName;
|
|
55296
|
+
(function (SchemeName) {
|
|
55297
|
+
SchemeName["Ftfs"] = "ftfs";
|
|
55298
|
+
})(SchemeName = exports.SchemeName || (exports.SchemeName = {}));
|
|
55299
|
+
|
|
55300
|
+
|
|
55301
|
+
/***/ }),
|
|
55302
|
+
|
|
55303
|
+
/***/ 67080:
|
|
55304
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
55305
|
+
|
|
55306
|
+
"use strict";
|
|
55307
|
+
|
|
55308
|
+
function __export(m) {
|
|
55309
|
+
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
|
55310
|
+
}
|
|
55311
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
55312
|
+
__export(__webpack_require__(29638));
|
|
55313
|
+
|
|
55314
|
+
|
|
55315
|
+
/***/ }),
|
|
55316
|
+
|
|
55317
|
+
/***/ 29638:
|
|
55318
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
55319
|
+
|
|
55320
|
+
"use strict";
|
|
55321
|
+
|
|
55322
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
55323
|
+
var HAlign;
|
|
55324
|
+
(function (HAlign) {
|
|
55325
|
+
HAlign["initial"] = "Initial";
|
|
55326
|
+
HAlign["left"] = "Left";
|
|
55327
|
+
HAlign["center"] = "Center";
|
|
55328
|
+
HAlign["right"] = "Right";
|
|
55329
|
+
HAlign["begin"] = "Begin";
|
|
55330
|
+
HAlign["end"] = "End";
|
|
55331
|
+
})(HAlign = exports.HAlign || (exports.HAlign = {}));
|
|
55332
|
+
var TableMode;
|
|
55333
|
+
(function (TableMode) {
|
|
55334
|
+
TableMode["None"] = "None";
|
|
55335
|
+
TableMode["SingleSelect"] = "SingleSelect";
|
|
55336
|
+
TableMode["SingleSelectLeft"] = "SingleSelectLeft";
|
|
55337
|
+
TableMode["SingleSelectMaster"] = "SingleSelectMaster";
|
|
55338
|
+
TableMode["MultiSelect"] = "MultiSelect";
|
|
55339
|
+
TableMode["Delete"] = "Delete";
|
|
55340
|
+
})(TableMode = exports.TableMode || (exports.TableMode = {}));
|
|
55341
|
+
|
|
55342
|
+
|
|
55343
|
+
/***/ }),
|
|
55344
|
+
|
|
55345
|
+
/***/ 72194:
|
|
55346
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
55347
|
+
|
|
55348
|
+
"use strict";
|
|
55349
|
+
|
|
55350
|
+
function __export(m) {
|
|
55351
|
+
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
|
55352
|
+
}
|
|
55353
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
55354
|
+
__export(__webpack_require__(4585));
|
|
55355
|
+
__export(__webpack_require__(67080));
|
|
55356
|
+
__export(__webpack_require__(61144));
|
|
55357
|
+
__export(__webpack_require__(37413));
|
|
55358
|
+
__export(__webpack_require__(69681));
|
|
55359
|
+
__export(__webpack_require__(68858));
|
|
55360
|
+
__export(__webpack_require__(54688));
|
|
55361
|
+
exports.location = () => {
|
|
55362
|
+
// While generating schemas we use location (file path as string) to reference this lib. For Windows we need to change from single backslash to forward slash
|
|
55363
|
+
return __dirname.replace(/\\/g, '/');
|
|
55364
|
+
};
|
|
55365
|
+
|
|
55366
|
+
|
|
55367
|
+
/***/ }),
|
|
55368
|
+
|
|
55369
|
+
/***/ 68858:
|
|
55370
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
55371
|
+
|
|
55372
|
+
"use strict";
|
|
55373
|
+
|
|
55374
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
55375
|
+
var UI5FlexLayer;
|
|
55376
|
+
(function (UI5FlexLayer) {
|
|
55377
|
+
UI5FlexLayer["VENDOR"] = "VENDOR";
|
|
55378
|
+
UI5FlexLayer["CUSTOMER_BASE"] = "CUSTOMER_BASE";
|
|
55379
|
+
})(UI5FlexLayer = exports.UI5FlexLayer || (exports.UI5FlexLayer = {}));
|
|
55380
|
+
|
|
55381
|
+
|
|
55382
|
+
/***/ }),
|
|
55383
|
+
|
|
55384
|
+
/***/ 61144:
|
|
55385
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
55386
|
+
|
|
55387
|
+
"use strict";
|
|
55388
|
+
|
|
55389
|
+
function __export(m) {
|
|
55390
|
+
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
|
55391
|
+
}
|
|
55392
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
55393
|
+
__export(__webpack_require__(39070));
|
|
55394
|
+
|
|
55395
|
+
|
|
55396
|
+
/***/ }),
|
|
55397
|
+
|
|
55398
|
+
/***/ 39070:
|
|
55399
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
55400
|
+
|
|
55401
|
+
"use strict";
|
|
55402
|
+
|
|
55403
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
55404
|
+
var PageType;
|
|
55405
|
+
(function (PageType) {
|
|
55406
|
+
PageType["ObjectPage"] = "ObjectPage";
|
|
55407
|
+
PageType["ListReport"] = "ListReport";
|
|
55408
|
+
PageType["OverviewPage"] = "OverviewPage";
|
|
55409
|
+
PageType["CustomPage"] = "CustomPage";
|
|
55410
|
+
PageType["AnalyticalListPage"] = "AnalyticalListPage";
|
|
55411
|
+
})(PageType = exports.PageType || (exports.PageType = {}));
|
|
55412
|
+
|
|
55413
|
+
|
|
55414
|
+
/***/ }),
|
|
55415
|
+
|
|
55416
|
+
/***/ 54688:
|
|
55417
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
55418
|
+
|
|
55419
|
+
"use strict";
|
|
55420
|
+
|
|
55421
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
55422
|
+
var ProjectType;
|
|
55423
|
+
(function (ProjectType) {
|
|
55424
|
+
ProjectType["Cap"] = "Cap";
|
|
55425
|
+
ProjectType["Edmx"] = "Edmx";
|
|
55426
|
+
})(ProjectType = exports.ProjectType || (exports.ProjectType = {}));
|
|
55427
|
+
var DetailedProjectType;
|
|
55428
|
+
(function (DetailedProjectType) {
|
|
55429
|
+
DetailedProjectType["Edxm"] = "EDMX Backend";
|
|
55430
|
+
DetailedProjectType["CAPNode"] = "CAP Node.js";
|
|
55431
|
+
DetailedProjectType["CAPJava"] = "CAP Java";
|
|
55432
|
+
})(DetailedProjectType = exports.DetailedProjectType || (exports.DetailedProjectType = {}));
|
|
55433
|
+
|
|
55434
|
+
|
|
55435
|
+
/***/ }),
|
|
55436
|
+
|
|
55437
|
+
/***/ 37413:
|
|
55438
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
55439
|
+
|
|
55440
|
+
"use strict";
|
|
55441
|
+
|
|
55442
|
+
function __export(m) {
|
|
55443
|
+
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
|
55444
|
+
}
|
|
55445
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
55446
|
+
__export(__webpack_require__(33803));
|
|
55447
|
+
|
|
55448
|
+
|
|
55449
|
+
/***/ }),
|
|
55450
|
+
|
|
55451
|
+
/***/ 33803:
|
|
55452
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
55453
|
+
|
|
55454
|
+
"use strict";
|
|
55455
|
+
|
|
55456
|
+
function __export(m) {
|
|
55457
|
+
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
|
55458
|
+
}
|
|
55459
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
55460
|
+
__export(__webpack_require__(91225));
|
|
55461
|
+
var DataSourceType;
|
|
55462
|
+
(function (DataSourceType) {
|
|
55463
|
+
DataSourceType["OData"] = "OData";
|
|
55464
|
+
DataSourceType["ODataAnnotation"] = "ODataAnnotation";
|
|
55465
|
+
})(DataSourceType = exports.DataSourceType || (exports.DataSourceType = {}));
|
|
55466
|
+
|
|
55467
|
+
|
|
55468
|
+
/***/ }),
|
|
55469
|
+
|
|
55470
|
+
/***/ 91225:
|
|
55471
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
55472
|
+
|
|
55473
|
+
"use strict";
|
|
55474
|
+
|
|
55475
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
55476
|
+
exports.FIORI_FCL_ROUTER_CLASS = 'sap.f.routing.Router';
|
|
55477
|
+
exports.FIORI_FCL_ROOT_VIEW_NAME = 'sap.fe.templates.RootContainer.view.Fcl';
|
|
55478
|
+
exports.FIORI_FCL_ROOT_ID = 'appRootView';
|
|
55479
|
+
var FlexibleColumnLayoutAggregations;
|
|
55480
|
+
(function (FlexibleColumnLayoutAggregations) {
|
|
55481
|
+
FlexibleColumnLayoutAggregations["BeginColumnPages"] = "beginColumnPages";
|
|
55482
|
+
FlexibleColumnLayoutAggregations["MidColumnPages"] = "midColumnPages";
|
|
55483
|
+
FlexibleColumnLayoutAggregations["EndColumnPages"] = "endColumnPages";
|
|
55484
|
+
})(FlexibleColumnLayoutAggregations = exports.FlexibleColumnLayoutAggregations || (exports.FlexibleColumnLayoutAggregations = {}));
|
|
55485
|
+
// Values copy/pasted from 'sap/f/library' sources
|
|
55486
|
+
var FlexibleColumnLayoutType;
|
|
55487
|
+
(function (FlexibleColumnLayoutType) {
|
|
55488
|
+
FlexibleColumnLayoutType["OneColumn"] = "OneColumn";
|
|
55489
|
+
FlexibleColumnLayoutType["TwoColumnsBeginExpanded"] = "TwoColumnsBeginExpanded";
|
|
55490
|
+
FlexibleColumnLayoutType["TwoColumnsMidExpanded"] = "TwoColumnsMidExpanded";
|
|
55491
|
+
FlexibleColumnLayoutType["MidColumnFullScreen"] = "MidColumnFullScreen";
|
|
55492
|
+
FlexibleColumnLayoutType["ThreeColumnsMidExpanded"] = "ThreeColumnsMidExpanded";
|
|
55493
|
+
FlexibleColumnLayoutType["ThreeColumnsEndExpanded"] = "ThreeColumnsEndExpanded";
|
|
55494
|
+
FlexibleColumnLayoutType["ThreeColumnsMidExpandedEndHidden"] = "ThreeColumnsMidExpandedEndHidden";
|
|
55495
|
+
FlexibleColumnLayoutType["ThreeColumnsBeginExpandedEndHidden"] = "ThreeColumnsBeginExpandedEndHidden";
|
|
55496
|
+
FlexibleColumnLayoutType["EndColumnFullScreen"] = "EndColumnFullScreen";
|
|
55497
|
+
})(FlexibleColumnLayoutType = exports.FlexibleColumnLayoutType || (exports.FlexibleColumnLayoutType = {}));
|
|
55498
|
+
var ViewTypes;
|
|
55499
|
+
(function (ViewTypes) {
|
|
55500
|
+
ViewTypes["XML"] = "XML";
|
|
55501
|
+
ViewTypes["HTML"] = "HTML";
|
|
55502
|
+
ViewTypes["JS"] = "JS";
|
|
55503
|
+
ViewTypes["JSON"] = "JSON";
|
|
55504
|
+
})(ViewTypes = exports.ViewTypes || (exports.ViewTypes = {}));
|
|
55505
|
+
|
|
55506
|
+
|
|
55206
55507
|
/***/ }),
|
|
55207
55508
|
|
|
55208
55509
|
/***/ 66170:
|
|
@@ -55251,6 +55552,7 @@ const i18next_1 = __importDefault(__webpack_require__(70075));
|
|
|
55251
55552
|
const i18n_1 = __webpack_require__(66170);
|
|
55252
55553
|
const utils_1 = __webpack_require__(27794);
|
|
55253
55554
|
const fs_1 = __webpack_require__(35747);
|
|
55555
|
+
const project_spec_1 = __webpack_require__(72194);
|
|
55254
55556
|
/**
|
|
55255
55557
|
* Custom UI5 Server middleware example
|
|
55256
55558
|
*
|
|
@@ -55290,7 +55592,7 @@ module.exports = async function ({ options }) {
|
|
|
55290
55592
|
cert: await fs_1.promises.readFile(cert)
|
|
55291
55593
|
};
|
|
55292
55594
|
}
|
|
55293
|
-
const watchPath = options.configuration.path ||
|
|
55595
|
+
const watchPath = options.configuration.path || project_spec_1.DirName.Webapp;
|
|
55294
55596
|
const projectPath = process.cwd();
|
|
55295
55597
|
const fullWatchPath = path_1.join(projectPath, watchPath);
|
|
55296
55598
|
const livereloadServer = livereload_1.createServer(livereloadOptions, () => {
|
|
@@ -55361,7 +55663,7 @@ exports.exposeLivereloadPort = async (port, log) => {
|
|
|
55361
55663
|
/***/ ((module) => {
|
|
55362
55664
|
|
|
55363
55665
|
"use strict";
|
|
55364
|
-
module.exports = JSON.parse('{"ABAP_PACKAGE":"ABAP package","ADDING_ARTIFACT_TO_PROJECT":"Adding {{artifact}} to the project.","APPLICATION_NAME":"Application Name","ARTIFACT_ADDED":"{{artifact}} added to the project.","ARTIFACT_NOT_ADDED":"{{artifact}} not added to the project.","CLIENT":"Client","CONFIRM_DEPLOYMENT":"Confirmation is required to deploy the app:","CONNECTING_WITHOUT_CREDS":"Connecting without any credentials, deployment may fail if authorization is required","CONSIDER_REMOVING_CLIENT_FROM_CONFIG":"Please remove the client from ui5-deploy.yaml, if you don\'t want to see the above warning again","DEPLOY_CANCELED":"Deploy canceled","DEPLOY_EXECUTED":"deploy executed.","DESTINATION":"Destination","ERROR_COMMAND_CMD":"Command {{cmd}} does not exist.","ERROR_INVALID_DEPLOYMENT_CONFIGURATION":"Invalid deployment configuration. Property {{property}} is missing.","ERROR_USER_PASSWORD_PLAIN":"Username or password must not be provided in plain text. Use environment variables.","ERROR_YO_NOT_INSTALLED":"Yeoman is not installed or available in your executable path. Please check your configuration or use npm/yarn to install it globally","ERROR_INSTALL_FIORI_GENERATOR":"Do you need to install {{fioriGenerator}} globally?\\nnpm install -g {{fioriGenerator}}\\nOR\\nyarn global add {{fioriGenerator}}","FILE_CREATED":"File {{file}} created in {{- folder}}","GENERATE_STANDALONE_INDEX_HTML":"Generate standalone index.html during deployment","INDEX_EXISTS_NOT_OVERWRITING":"\'index.html\' already exists, not generating one","INDEX_HTML_ADDED":"index.html added","INFO_CREATE_ARCHIVE":"Create Archive","INFO_COMMAND_FAILED":"Command {{cmd}} failed with error {{-message}}","INFO_DEPLOYMENT_SUCCESSFUL":"Deployment Successful.","INFO_DEPLOYMENT_FAILED":"Deployment Failed.","INFO_FILE_PATH_ADDED":"{{path}} added","INFO_LIVERELOAD_STARTED":"Livereload middleware started for port {{port}} and path {{-watchPath}}","ERROR_STARTING_LIVERELOAD":"Port {{port}} was not exposed! Livereload will not work!","INFO_STARTING_DEPLOYMENT":"Starting Deployment.","INFO_STORE_DETAILS":"Storing details for system: ","INFO_USED_DESTINATION":"Used destination: ","INVALID_DATA":"Invalid data","INVALID_ODATA_VERSION":"The middleware fiori-tools-preview can only be used with OData version 4","MAINTAIN_CREDENTIALS":"Please maintain correct credentials to avoid seeing this error\\n\\t(see help: https://www.npmjs.com/package/@sap/ux-ui5-tooling#setting-environment-variables-in-a-env-file)","NO_PATH_LOCAL_UI5":"No path to local UI5 sources provided!","PACKAGE":"Package","PACKAGE_JSON_UPDATED":"package.json updated.","PACKAGE_NAME_REQUIRED":"Package name required","PROXY_STARTED_FOR":"Proxy started for ","SERVICE_KEYS_CONTENT_EMPTY":"Service keys contents cannot be empty","START_DEPLOYMENT":"Start deployment (Y/n)?","SYSTEM_NAME_EMPTY":"System Name cannot be empty","SYSTEM_NAME_IN_USE":"[{{name}}] is already in use","TARGET":"Target","TRANSPORT_REQUEST":"Transport Request","USE_IT_INSTEAD":"Use it instead (Y/n)?","USING_SYSTEM_WITH_SAME_URL_NO_CLIENT":"Using system [{{name}}] with same URL, no client from System Store","USING_SYSTEM_FROM_STORE":"Using system [{{name}}] from System store","VARIANTS_MANAGEMENT_NOT_SUPPORTED":"Variants Management is supported only with OData version 4","WARNING_PACKAGE_IN_CUSTOMER_SPACE":"Your package is in the customer space. Please check the correctness of the application name as it might need to start with a Z.","ERROR_EXTRACT_API_KEY":"Could not extract API hub key from \'{{-envPath}}\'","ERROR_API_HUB_KEY":"Property apiHub is set to true in yaml file, but file \'{{-envPath}}\' doesn\'t contain API key. Error was: ${{-message}}","SSL_IGNORE_WARNING":"You chose not to validate SSL certificate. Please verify the server certificate is trustful before proceeding. See documentation for recommended configuration (https://help.sap.com/viewer/17d50220bcd848aa854c9c182d65b699/Latest/en-US/4b318bede7eb4021a8be385c46c74045.html).","SSL_PROXY_ERROR":"You are trying to connect to a server with a self signed certificate. Please check (https://help.sap.com/viewer/17d50220bcd848aa854c9c182d65b699/Latest/en-US/4b318bede7eb4021a8be385c46c74045.html) for guidance.","NO_DEPLOY_CONFIG":"No deployment configuration has been detected. Run `npm run deploy-config` to add configuration first.","NO_BSP_APPLICATION":"Mandatory parameter --bspApplication <value> is missing. Please provide BSP Application","YAML_NOT_FOUND":"Configuration file {{-yamlPath}} not found. Please provide a valid path","NO_BUILD_SCRIPT":"Warning: No build script was found. You will need to execute build, before running start-flp.","CONFIRM_UNDEPLOYMENT":"Confirmation is required to undeploy the app:","INFO_STARTING_UNDEPLOYMENT":"Starting undeployment.","INFO_UNDEPLOYMENT_SUCCESSFUL":"Undeployment Successful.","INFO_UNDEPLOYMENT_FAILED":"Undeployment Failed.","START_UNDEPLOYMENT":"Start undeployment (Y/n)?","USERNAME":"Username:","PASSWORD":"Password:","REQUIRE_CREDENTIAL":"The deployment destination requires authentication. Please enter your credentials below","REQUIRE_CREDENTIAL_FLP":"The FLP Embedded Preview requires credentials. Please enter your credentials below","ERROR_NO_VSCODE_SETTINGS_FILE":"No VSCode Settings file found.","INFO_SAML_NOT_SUPPORTED":"The backend service seems to require direct SAML authentication, which is not yet supported.","INFO_RESPONSE_UNCERTAIN":"Successful deployment could not be confirmed based on the response message received. Please manually verify if the deployment was successful.","VSCODE_SETTINGS_FILE_NOT_PARSEABLE":"Not able to parse VSCode settings.json file.","ERROR_EMPTY_USERNAME":"Username can not be empty.","ERROR_EMPTY_PASSWORD":"Password can not be empty.","OPERATION_ABORTED":"Operation aborted by the user.","ERROR_ACHIVE_FROM_EXTERNAL_FILEPATH":"The archive file you provided could not be found.","ERROR_ACHIVE_FROM_EXTERNAL_URL":"The archive url you provided could not be reached. Please ensure the URL is accessible and does not require authentication. {{error}}","NO_CAP":"CAP projects are not supported.","DEPLOYMENT_MSG":"To retrieve the deployed URL, run the following command:","DEPLOYMENT_MANAGED_CF_URL":"cf html5-list -u -di {{-mtaId}}-dest-srv -u --runtime launchpad","DEPLOYMENT_HELP":"For more help, go to https://help.sap.com/viewer/17d50220bcd848aa854c9c182d65b699/Latest/en-US/607014e278d941fda4440f92f4a324a6.html","DEPLOYMENT_STANDALONE_CF_URL":"Please see the deployed application URL above","CONTROL_PROPERTY_EDITOR_UNSUPPORTED_FE_VERSION":"Control property editor is available only for
|
|
55666
|
+
module.exports = JSON.parse('{"ABAP_PACKAGE":"ABAP package","ADDING_ARTIFACT_TO_PROJECT":"Adding {{artifact}} to the project.","APPLICATION_NAME":"Application Name","ARTIFACT_ADDED":"{{artifact}} added to the project.","ARTIFACT_NOT_ADDED":"{{artifact}} not added to the project.","CLIENT":"Client","CONFIRM_DEPLOYMENT_TESTMODE":"Confirmation is required to deploy the app in test mode:","CONFIRM_DEPLOYMENT":"Confirmation is required to deploy the app:","CONNECTING_WITHOUT_CREDS":"Connecting without any credentials, deployment may fail if authorization is required","CONSIDER_REMOVING_CLIENT_FROM_CONFIG":"Please remove the client from ui5-deploy.yaml, if you don\'t want to see the above warning again","DEPLOY_CANCELED":"Deploy canceled","DEPLOY_EXECUTED":"deploy executed.","DESTINATION":"Destination","ERROR_COMMAND_CMD":"Command {{cmd}} does not exist.","ERROR_INVALID_DEPLOYMENT_CONFIGURATION":"Invalid deployment configuration. Property {{property}} is missing.","ERROR_USER_PASSWORD_PLAIN":"Username or password must not be provided in plain text. Use environment variables.","ERROR_YO_NOT_INSTALLED":"Yeoman is not installed or available in your executable path. Please check your configuration or use npm/yarn to install it globally","ERROR_INSTALL_FIORI_GENERATOR":"Do you need to install {{fioriGenerator}} globally?\\nnpm install -g {{fioriGenerator}}\\nOR\\nyarn global add {{fioriGenerator}}","FILE_CREATED":"File {{file}} created in {{- folder}}","GENERATE_STANDALONE_INDEX_HTML":"Generate standalone index.html during deployment","INDEX_EXISTS_NOT_OVERWRITING":"\'index.html\' already exists, not generating one","INDEX_HTML_ADDED":"index.html added","INFO_CREATE_ARCHIVE":"Create Archive","INFO_COMMAND_FAILED":"Command {{cmd}} failed with error {{-message}}","INFO_DEPLOYMENT_SUCCESSFUL":"Deployment Successful.","INFO_DEPLOYMENT_FAILED":"Deployment Failed.","ERROR_NO_SYSTEM_IN_STORE":"Error in deployment. The BTP system used in the deployment configuration could not be found as one of your local saved SAP systems. Please ensure you have saved this system locally so that it can be used for deployment.","INFO_FILE_PATH_ADDED":"{{path}} added","INFO_LIVERELOAD_STARTED":"Livereload middleware started for port {{port}} and path {{-watchPath}}","ERROR_STARTING_LIVERELOAD":"Port {{port}} was not exposed! Livereload will not work!","INFO_STARTING_DEPLOYMENT":"Starting Deployment.","INFO_STORE_DETAILS":"Storing details for system: ","INFO_USED_DESTINATION":"Used destination: ","INVALID_DATA":"Invalid data","INVALID_ODATA_VERSION":"The middleware fiori-tools-preview can only be used with OData version 4","MAINTAIN_CREDENTIALS":"Please maintain correct credentials to avoid seeing this error\\n\\t(see help: https://www.npmjs.com/package/@sap/ux-ui5-tooling#setting-environment-variables-in-a-env-file)","NO_PATH_LOCAL_UI5":"No path to local UI5 sources provided!","PACKAGE":"Package","PACKAGE_JSON_UPDATED":"package.json updated.","PACKAGE_NAME_REQUIRED":"Package name required","PROXY_STARTED_FOR":"Proxy started for ","SERVICE_KEYS_CONTENT_EMPTY":"Service keys contents cannot be empty","START_DEPLOYMENT":"Start deployment (Y/n)?","START_DEPLOYMENT_TESTMODE":"Start deployment in test mode (Y/n)?","SYSTEM_NAME_EMPTY":"System Name cannot be empty","SYSTEM_NAME_IN_USE":"[{{name}}] is already in use","TARGET":"Target","TRANSPORT_REQUEST":"Transport Request","USE_IT_INSTEAD":"Use it instead (Y/n)?","USING_SYSTEM_WITH_SAME_URL_NO_CLIENT":"Using system [{{name}}] with same URL, no client from System Store","USING_SYSTEM_FROM_STORE":"Using system [{{name}}] from System store","VARIANTS_MANAGEMENT_NOT_SUPPORTED":"Variants Management is supported only with OData version 4","WARNING_PACKAGE_IN_CUSTOMER_SPACE":"Your package is in the customer space. Please check the correctness of the application name as it might need to start with a Z.","ERROR_EXTRACT_API_KEY":"Could not extract API hub key from \'{{-envPath}}\'","ERROR_API_HUB_KEY":"Property apiHub is set to true in yaml file, but file \'{{-envPath}}\' doesn\'t contain API key. Error was: ${{-message}}","SSL_IGNORE_WARNING":"You chose not to validate SSL certificate. Please verify the server certificate is trustful before proceeding. See documentation for recommended configuration (https://help.sap.com/viewer/17d50220bcd848aa854c9c182d65b699/Latest/en-US/4b318bede7eb4021a8be385c46c74045.html).","SSL_PROXY_ERROR":"You are trying to connect to a server with a self signed certificate. Please check (https://help.sap.com/viewer/17d50220bcd848aa854c9c182d65b699/Latest/en-US/4b318bede7eb4021a8be385c46c74045.html) for guidance.","NO_DEPLOY_CONFIG":"No deployment configuration has been detected. Run `npm run deploy-config` to add configuration first.","NO_BSP_APPLICATION":"Mandatory parameter --bspApplication <value> is missing. Please provide BSP Application","YAML_NOT_FOUND":"Configuration file {{-yamlPath}} not found. Please provide a valid path","NO_BUILD_SCRIPT":"Warning: No build script was found. You will need to execute build, before running start-flp.","CONFIRM_UNDEPLOYMENT":"Confirmation is required to undeploy the app:","INFO_STARTING_UNDEPLOYMENT":"Starting undeployment.","INFO_UNDEPLOYMENT_SUCCESSFUL":"Undeployment Successful.","INFO_UNDEPLOYMENT_FAILED":"Undeployment Failed.","START_UNDEPLOYMENT":"Start undeployment (Y/n)?","USERNAME":"Username:","PASSWORD":"Password:","REQUIRE_CREDENTIAL":"The deployment destination requires authentication. Please enter your credentials below","REQUIRE_CREDENTIAL_FLP":"The FLP Embedded Preview requires credentials. Please enter your credentials below","ERROR_NO_VSCODE_SETTINGS_FILE":"No VSCode Settings file found.","INFO_SAML_NOT_SUPPORTED":"The backend service seems to require direct SAML authentication, which is not yet supported.","INFO_RESPONSE_UNCERTAIN":"Successful deployment could not be confirmed based on the response message received. Please manually verify if the deployment was successful.","VSCODE_SETTINGS_FILE_NOT_PARSEABLE":"Not able to parse VSCode settings.json file.","ERROR_EMPTY_USERNAME":"Username can not be empty.","ERROR_EMPTY_PASSWORD":"Password can not be empty.","OPERATION_ABORTED":"Operation aborted by the user.","ERROR_ACHIVE_FROM_EXTERNAL_FILEPATH":"The archive file you provided could not be found.","ERROR_ACHIVE_FROM_EXTERNAL_URL":"The archive url you provided could not be reached. Please ensure the URL is accessible and does not require authentication. {{error}}","NO_CAP":"CAP projects are not supported.","DEPLOYMENT_MSG":"To retrieve the deployed URL, run the following command:","DEPLOYMENT_MANAGED_CF_URL":"cf html5-list -u -di {{-mtaId}}-dest-srv -u --runtime launchpad","DEPLOYMENT_HELP":"For more help, go to https://help.sap.com/viewer/17d50220bcd848aa854c9c182d65b699/Latest/en-US/607014e278d941fda4440f92f4a324a6.html","DEPLOYMENT_STANDALONE_CF_URL":"Please see the deployed application URL above","ERROR_NO_UI5_FLEX_LAYER":"The UI5 Flexibility Layer for this project is not set. Please open the command palette and execute the command {{command}}.","ERROR_WRONG_UI5_FLEX_LAYER":"The value of the UI5 Flexibility Layer is wrong. Please open the command palette and execute the command {{command}}.","ERROR_NO_MINUI5VERSION":"The minUI5Version is missing. Please update the minUI5Version in the manifest.json to {{version}} or higher.","ERROR_WRONG_MINUI5VERSION":"Variant management works only with minUI5Version {{version}} or higher. Please update the minUI5Version in the manifest.json to {{version}} or higher.","ERROR_WRONG_UI5VERSION":"Variant management works only with UI5 version {{version}} or higher. Please update the UI5 version in the {{ui5Yaml}} to {{version}} or higher.","VARIANT_MANAGEMENT_VSCODE_CONFIGURATION_COMMAND":"Fiori: Add Configuration for Variants Creation","NO_HELP_MARKDOWN_FOUND":"Help content cannot be loaded","UNKNOWN_ADD_SUBCOMMAND":"Subcommand {{artifact}} is not supported. Please check the following supported subcommands.","CONTROL_PROPERTY_EDITOR_UNSUPPORTED_FE_VERSION":"Control property editor is available only for SAP Fiori Elements v2 apps","CONTROL_PROPERTY_EDITOR_MIN_UI5_VERSION":"Control property editor works only with SAP UI5 version {{version}} or higher. Please update the SAP UI5 version in the {{ui5Yaml}} to {{version}} or higher.","CONTROL_PROPERTY_EDITOR_VSCODE_CONFIGURATION_COMMAND":"Fiori: Add Configuration for Control Property Editor"}');
|
|
55365
55667
|
|
|
55366
55668
|
/***/ }),
|
|
55367
55669
|
|