netlicensing-client 1.2.38 → 1.2.40
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/dist/netlicensing-client.js +17 -28
- package/dist/netlicensing-client.min.js +1 -1
- package/dist/netlicensing-client.min.js.LICENSE.txt +2 -0
- package/dist/netlicensing-client.node.js +188 -171
- package/dist/netlicensing-client.node.min.js +1 -1
- package/dist/netlicensing-client.node.min.js.LICENSE.txt +2 -0
- package/package.json +2 -2
|
@@ -1830,6 +1830,9 @@ module.exports = setup;
|
|
|
1830
1830
|
/***/ 737:
|
|
1831
1831
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
1832
1832
|
|
|
1833
|
+
"use strict";
|
|
1834
|
+
|
|
1835
|
+
|
|
1833
1836
|
var CombinedStream = __webpack_require__(801);
|
|
1834
1837
|
var util = __webpack_require__(9023);
|
|
1835
1838
|
var path = __webpack_require__(6928);
|
|
@@ -1838,24 +1841,20 @@ var https = __webpack_require__(5692);
|
|
|
1838
1841
|
var parseUrl = (__webpack_require__(7016).parse);
|
|
1839
1842
|
var fs = __webpack_require__(9896);
|
|
1840
1843
|
var Stream = (__webpack_require__(2203).Stream);
|
|
1844
|
+
var crypto = __webpack_require__(6982);
|
|
1841
1845
|
var mime = __webpack_require__(6049);
|
|
1842
1846
|
var asynckit = __webpack_require__(1873);
|
|
1843
1847
|
var setToStringTag = __webpack_require__(9605);
|
|
1848
|
+
var hasOwn = __webpack_require__(9957);
|
|
1844
1849
|
var populate = __webpack_require__(1362);
|
|
1845
1850
|
|
|
1846
|
-
// Public API
|
|
1847
|
-
module.exports = FormData;
|
|
1848
|
-
|
|
1849
|
-
// make it a Stream
|
|
1850
|
-
util.inherits(FormData, CombinedStream);
|
|
1851
|
-
|
|
1852
1851
|
/**
|
|
1853
1852
|
* Create readable "multipart/form-data" streams.
|
|
1854
1853
|
* Can be used to submit forms
|
|
1855
1854
|
* and file uploads to other web applications.
|
|
1856
1855
|
*
|
|
1857
1856
|
* @constructor
|
|
1858
|
-
* @param {
|
|
1857
|
+
* @param {object} options - Properties to be added/overriden for FormData and CombinedStream
|
|
1859
1858
|
*/
|
|
1860
1859
|
function FormData(options) {
|
|
1861
1860
|
if (!(this instanceof FormData)) {
|
|
@@ -1868,35 +1867,39 @@ function FormData(options) {
|
|
|
1868
1867
|
|
|
1869
1868
|
CombinedStream.call(this);
|
|
1870
1869
|
|
|
1871
|
-
options = options || {};
|
|
1872
|
-
for (var option in options) {
|
|
1870
|
+
options = options || {}; // eslint-disable-line no-param-reassign
|
|
1871
|
+
for (var option in options) { // eslint-disable-line no-restricted-syntax
|
|
1873
1872
|
this[option] = options[option];
|
|
1874
1873
|
}
|
|
1875
1874
|
}
|
|
1876
1875
|
|
|
1876
|
+
// make it a Stream
|
|
1877
|
+
util.inherits(FormData, CombinedStream);
|
|
1878
|
+
|
|
1877
1879
|
FormData.LINE_BREAK = '\r\n';
|
|
1878
1880
|
FormData.DEFAULT_CONTENT_TYPE = 'application/octet-stream';
|
|
1879
1881
|
|
|
1880
|
-
FormData.prototype.append = function(field, value, options) {
|
|
1881
|
-
|
|
1882
|
-
options = options || {};
|
|
1882
|
+
FormData.prototype.append = function (field, value, options) {
|
|
1883
|
+
options = options || {}; // eslint-disable-line no-param-reassign
|
|
1883
1884
|
|
|
1884
1885
|
// allow filename as single option
|
|
1885
|
-
if (typeof options
|
|
1886
|
-
options = {filename: options};
|
|
1886
|
+
if (typeof options === 'string') {
|
|
1887
|
+
options = { filename: options }; // eslint-disable-line no-param-reassign
|
|
1887
1888
|
}
|
|
1888
1889
|
|
|
1889
1890
|
var append = CombinedStream.prototype.append.bind(this);
|
|
1890
1891
|
|
|
1891
1892
|
// all that streamy business can't handle numbers
|
|
1892
|
-
if (typeof value
|
|
1893
|
-
value =
|
|
1893
|
+
if (typeof value === 'number' || value == null) {
|
|
1894
|
+
value = String(value); // eslint-disable-line no-param-reassign
|
|
1894
1895
|
}
|
|
1895
1896
|
|
|
1896
1897
|
// https://github.com/felixge/node-form-data/issues/38
|
|
1897
1898
|
if (Array.isArray(value)) {
|
|
1898
|
-
|
|
1899
|
-
|
|
1899
|
+
/*
|
|
1900
|
+
* Please convert your array into string
|
|
1901
|
+
* the way web server expects it
|
|
1902
|
+
*/
|
|
1900
1903
|
this._error(new Error('Arrays are not supported.'));
|
|
1901
1904
|
return;
|
|
1902
1905
|
}
|
|
@@ -1912,15 +1915,17 @@ FormData.prototype.append = function(field, value, options) {
|
|
|
1912
1915
|
this._trackLength(header, value, options);
|
|
1913
1916
|
};
|
|
1914
1917
|
|
|
1915
|
-
FormData.prototype._trackLength = function(header, value, options) {
|
|
1918
|
+
FormData.prototype._trackLength = function (header, value, options) {
|
|
1916
1919
|
var valueLength = 0;
|
|
1917
1920
|
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1921
|
+
/*
|
|
1922
|
+
* used w/ getLengthSync(), when length is known.
|
|
1923
|
+
* e.g. for streaming directly from a remote server,
|
|
1924
|
+
* w/ a known file a size, and not wanting to wait for
|
|
1925
|
+
* incoming file to finish to get its size.
|
|
1926
|
+
*/
|
|
1922
1927
|
if (options.knownLength != null) {
|
|
1923
|
-
valueLength +=
|
|
1928
|
+
valueLength += Number(options.knownLength);
|
|
1924
1929
|
} else if (Buffer.isBuffer(value)) {
|
|
1925
1930
|
valueLength = value.length;
|
|
1926
1931
|
} else if (typeof value === 'string') {
|
|
@@ -1930,12 +1935,10 @@ FormData.prototype._trackLength = function(header, value, options) {
|
|
|
1930
1935
|
this._valueLength += valueLength;
|
|
1931
1936
|
|
|
1932
1937
|
// @check why add CRLF? does this account for custom/multiple CRLFs?
|
|
1933
|
-
this._overheadLength +=
|
|
1934
|
-
Buffer.byteLength(header) +
|
|
1935
|
-
FormData.LINE_BREAK.length;
|
|
1938
|
+
this._overheadLength += Buffer.byteLength(header) + FormData.LINE_BREAK.length;
|
|
1936
1939
|
|
|
1937
1940
|
// empty or either doesn't have path or not an http response or not a stream
|
|
1938
|
-
if (!value || (
|
|
1941
|
+
if (!value || (!value.path && !(value.readable && hasOwn(value, 'httpVersion')) && !(value instanceof Stream))) {
|
|
1939
1942
|
return;
|
|
1940
1943
|
}
|
|
1941
1944
|
|
|
@@ -1945,9 +1948,8 @@ FormData.prototype._trackLength = function(header, value, options) {
|
|
|
1945
1948
|
}
|
|
1946
1949
|
};
|
|
1947
1950
|
|
|
1948
|
-
FormData.prototype._lengthRetriever = function(value, callback) {
|
|
1949
|
-
if (
|
|
1950
|
-
|
|
1951
|
+
FormData.prototype._lengthRetriever = function (value, callback) {
|
|
1952
|
+
if (hasOwn(value, 'fd')) {
|
|
1951
1953
|
// take read range into a account
|
|
1952
1954
|
// `end` = Infinity –> read file till the end
|
|
1953
1955
|
//
|
|
@@ -1956,54 +1958,52 @@ FormData.prototype._lengthRetriever = function(value, callback) {
|
|
|
1956
1958
|
// Fix it when node fixes it.
|
|
1957
1959
|
// https://github.com/joyent/node/issues/7819
|
|
1958
1960
|
if (value.end != undefined && value.end != Infinity && value.start != undefined) {
|
|
1959
|
-
|
|
1960
1961
|
// when end specified
|
|
1961
1962
|
// no need to calculate range
|
|
1962
1963
|
// inclusive, starts with 0
|
|
1963
|
-
callback(null, value.end + 1 - (value.start ? value.start : 0));
|
|
1964
|
+
callback(null, value.end + 1 - (value.start ? value.start : 0)); // eslint-disable-line callback-return
|
|
1964
1965
|
|
|
1965
|
-
|
|
1966
|
+
// not that fast snoopy
|
|
1966
1967
|
} else {
|
|
1967
1968
|
// still need to fetch file size from fs
|
|
1968
|
-
fs.stat(value.path, function(err, stat) {
|
|
1969
|
-
|
|
1970
|
-
var fileSize;
|
|
1971
|
-
|
|
1969
|
+
fs.stat(value.path, function (err, stat) {
|
|
1972
1970
|
if (err) {
|
|
1973
1971
|
callback(err);
|
|
1974
1972
|
return;
|
|
1975
1973
|
}
|
|
1976
1974
|
|
|
1977
1975
|
// update final size based on the range options
|
|
1978
|
-
fileSize = stat.size - (value.start ? value.start : 0);
|
|
1976
|
+
var fileSize = stat.size - (value.start ? value.start : 0);
|
|
1979
1977
|
callback(null, fileSize);
|
|
1980
1978
|
});
|
|
1981
1979
|
}
|
|
1982
1980
|
|
|
1983
|
-
|
|
1984
|
-
} else if (
|
|
1985
|
-
callback(null,
|
|
1981
|
+
// or http response
|
|
1982
|
+
} else if (hasOwn(value, 'httpVersion')) {
|
|
1983
|
+
callback(null, Number(value.headers['content-length'])); // eslint-disable-line callback-return
|
|
1986
1984
|
|
|
1987
|
-
|
|
1988
|
-
} else if (
|
|
1985
|
+
// or request stream http://github.com/mikeal/request
|
|
1986
|
+
} else if (hasOwn(value, 'httpModule')) {
|
|
1989
1987
|
// wait till response come back
|
|
1990
|
-
value.on('response', function(response) {
|
|
1988
|
+
value.on('response', function (response) {
|
|
1991
1989
|
value.pause();
|
|
1992
|
-
callback(null,
|
|
1990
|
+
callback(null, Number(response.headers['content-length']));
|
|
1993
1991
|
});
|
|
1994
1992
|
value.resume();
|
|
1995
1993
|
|
|
1996
|
-
|
|
1994
|
+
// something else
|
|
1997
1995
|
} else {
|
|
1998
|
-
callback('Unknown stream');
|
|
1996
|
+
callback('Unknown stream'); // eslint-disable-line callback-return
|
|
1999
1997
|
}
|
|
2000
1998
|
};
|
|
2001
1999
|
|
|
2002
|
-
FormData.prototype._multiPartHeader = function(field, value, options) {
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2000
|
+
FormData.prototype._multiPartHeader = function (field, value, options) {
|
|
2001
|
+
/*
|
|
2002
|
+
* custom header specified (as string)?
|
|
2003
|
+
* it becomes responsible for boundary
|
|
2004
|
+
* (e.g. to handle extra CRLFs on .NET servers)
|
|
2005
|
+
*/
|
|
2006
|
+
if (typeof options.header === 'string') {
|
|
2007
2007
|
return options.header;
|
|
2008
2008
|
}
|
|
2009
2009
|
|
|
@@ -2011,7 +2011,7 @@ FormData.prototype._multiPartHeader = function(field, value, options) {
|
|
|
2011
2011
|
var contentType = this._getContentType(value, options);
|
|
2012
2012
|
|
|
2013
2013
|
var contents = '';
|
|
2014
|
-
var headers
|
|
2014
|
+
var headers = {
|
|
2015
2015
|
// add custom disposition as third element or keep it two elements if not
|
|
2016
2016
|
'Content-Disposition': ['form-data', 'name="' + field + '"'].concat(contentDisposition || []),
|
|
2017
2017
|
// if no content type. allow it to be empty array
|
|
@@ -2019,18 +2019,18 @@ FormData.prototype._multiPartHeader = function(field, value, options) {
|
|
|
2019
2019
|
};
|
|
2020
2020
|
|
|
2021
2021
|
// allow custom headers.
|
|
2022
|
-
if (typeof options.header
|
|
2022
|
+
if (typeof options.header === 'object') {
|
|
2023
2023
|
populate(headers, options.header);
|
|
2024
2024
|
}
|
|
2025
2025
|
|
|
2026
2026
|
var header;
|
|
2027
|
-
for (var prop in headers) {
|
|
2028
|
-
if (
|
|
2027
|
+
for (var prop in headers) { // eslint-disable-line no-restricted-syntax
|
|
2028
|
+
if (hasOwn(headers, prop)) {
|
|
2029
2029
|
header = headers[prop];
|
|
2030
2030
|
|
|
2031
2031
|
// skip nullish headers.
|
|
2032
2032
|
if (header == null) {
|
|
2033
|
-
continue;
|
|
2033
|
+
continue; // eslint-disable-line no-restricted-syntax, no-continue
|
|
2034
2034
|
}
|
|
2035
2035
|
|
|
2036
2036
|
// convert all headers to arrays.
|
|
@@ -2048,49 +2048,45 @@ FormData.prototype._multiPartHeader = function(field, value, options) {
|
|
|
2048
2048
|
return '--' + this.getBoundary() + FormData.LINE_BREAK + contents + FormData.LINE_BREAK;
|
|
2049
2049
|
};
|
|
2050
2050
|
|
|
2051
|
-
FormData.prototype._getContentDisposition = function(value, options) {
|
|
2052
|
-
|
|
2053
|
-
var filename
|
|
2054
|
-
, contentDisposition
|
|
2055
|
-
;
|
|
2051
|
+
FormData.prototype._getContentDisposition = function (value, options) { // eslint-disable-line consistent-return
|
|
2052
|
+
var filename;
|
|
2056
2053
|
|
|
2057
2054
|
if (typeof options.filepath === 'string') {
|
|
2058
2055
|
// custom filepath for relative paths
|
|
2059
2056
|
filename = path.normalize(options.filepath).replace(/\\/g, '/');
|
|
2060
|
-
} else if (options.filename || value.name || value.path) {
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2057
|
+
} else if (options.filename || (value && (value.name || value.path))) {
|
|
2058
|
+
/*
|
|
2059
|
+
* custom filename take precedence
|
|
2060
|
+
* formidable and the browser add a name property
|
|
2061
|
+
* fs- and request- streams have path property
|
|
2062
|
+
*/
|
|
2063
|
+
filename = path.basename(options.filename || (value && (value.name || value.path)));
|
|
2064
|
+
} else if (value && value.readable && hasOwn(value, 'httpVersion')) {
|
|
2066
2065
|
// or try http response
|
|
2067
2066
|
filename = path.basename(value.client._httpMessage.path || '');
|
|
2068
2067
|
}
|
|
2069
2068
|
|
|
2070
2069
|
if (filename) {
|
|
2071
|
-
|
|
2070
|
+
return 'filename="' + filename + '"';
|
|
2072
2071
|
}
|
|
2073
|
-
|
|
2074
|
-
return contentDisposition;
|
|
2075
2072
|
};
|
|
2076
2073
|
|
|
2077
|
-
FormData.prototype._getContentType = function(value, options) {
|
|
2078
|
-
|
|
2074
|
+
FormData.prototype._getContentType = function (value, options) {
|
|
2079
2075
|
// use custom content-type above all
|
|
2080
2076
|
var contentType = options.contentType;
|
|
2081
2077
|
|
|
2082
2078
|
// or try `name` from formidable, browser
|
|
2083
|
-
if (!contentType && value.name) {
|
|
2079
|
+
if (!contentType && value && value.name) {
|
|
2084
2080
|
contentType = mime.lookup(value.name);
|
|
2085
2081
|
}
|
|
2086
2082
|
|
|
2087
2083
|
// or try `path` from fs-, request- streams
|
|
2088
|
-
if (!contentType && value.path) {
|
|
2084
|
+
if (!contentType && value && value.path) {
|
|
2089
2085
|
contentType = mime.lookup(value.path);
|
|
2090
2086
|
}
|
|
2091
2087
|
|
|
2092
2088
|
// or if it's http-reponse
|
|
2093
|
-
if (!contentType && value.readable &&
|
|
2089
|
+
if (!contentType && value && value.readable && hasOwn(value, 'httpVersion')) {
|
|
2094
2090
|
contentType = value.headers['content-type'];
|
|
2095
2091
|
}
|
|
2096
2092
|
|
|
@@ -2100,18 +2096,18 @@ FormData.prototype._getContentType = function(value, options) {
|
|
|
2100
2096
|
}
|
|
2101
2097
|
|
|
2102
2098
|
// fallback to the default content type if `value` is not simple value
|
|
2103
|
-
if (!contentType && typeof value
|
|
2099
|
+
if (!contentType && value && typeof value === 'object') {
|
|
2104
2100
|
contentType = FormData.DEFAULT_CONTENT_TYPE;
|
|
2105
2101
|
}
|
|
2106
2102
|
|
|
2107
2103
|
return contentType;
|
|
2108
2104
|
};
|
|
2109
2105
|
|
|
2110
|
-
FormData.prototype._multiPartFooter = function() {
|
|
2111
|
-
return function(next) {
|
|
2106
|
+
FormData.prototype._multiPartFooter = function () {
|
|
2107
|
+
return function (next) {
|
|
2112
2108
|
var footer = FormData.LINE_BREAK;
|
|
2113
2109
|
|
|
2114
|
-
var lastPart =
|
|
2110
|
+
var lastPart = this._streams.length === 0;
|
|
2115
2111
|
if (lastPart) {
|
|
2116
2112
|
footer += this._lastBoundary();
|
|
2117
2113
|
}
|
|
@@ -2120,18 +2116,18 @@ FormData.prototype._multiPartFooter = function() {
|
|
|
2120
2116
|
}.bind(this);
|
|
2121
2117
|
};
|
|
2122
2118
|
|
|
2123
|
-
FormData.prototype._lastBoundary = function() {
|
|
2119
|
+
FormData.prototype._lastBoundary = function () {
|
|
2124
2120
|
return '--' + this.getBoundary() + '--' + FormData.LINE_BREAK;
|
|
2125
2121
|
};
|
|
2126
2122
|
|
|
2127
|
-
FormData.prototype.getHeaders = function(userHeaders) {
|
|
2123
|
+
FormData.prototype.getHeaders = function (userHeaders) {
|
|
2128
2124
|
var header;
|
|
2129
2125
|
var formHeaders = {
|
|
2130
2126
|
'content-type': 'multipart/form-data; boundary=' + this.getBoundary()
|
|
2131
2127
|
};
|
|
2132
2128
|
|
|
2133
|
-
for (header in userHeaders) {
|
|
2134
|
-
if (
|
|
2129
|
+
for (header in userHeaders) { // eslint-disable-line no-restricted-syntax
|
|
2130
|
+
if (hasOwn(userHeaders, header)) {
|
|
2135
2131
|
formHeaders[header.toLowerCase()] = userHeaders[header];
|
|
2136
2132
|
}
|
|
2137
2133
|
}
|
|
@@ -2139,11 +2135,14 @@ FormData.prototype.getHeaders = function(userHeaders) {
|
|
|
2139
2135
|
return formHeaders;
|
|
2140
2136
|
};
|
|
2141
2137
|
|
|
2142
|
-
FormData.prototype.setBoundary = function(boundary) {
|
|
2138
|
+
FormData.prototype.setBoundary = function (boundary) {
|
|
2139
|
+
if (typeof boundary !== 'string') {
|
|
2140
|
+
throw new TypeError('FormData boundary must be a string');
|
|
2141
|
+
}
|
|
2143
2142
|
this._boundary = boundary;
|
|
2144
2143
|
};
|
|
2145
2144
|
|
|
2146
|
-
FormData.prototype.getBoundary = function() {
|
|
2145
|
+
FormData.prototype.getBoundary = function () {
|
|
2147
2146
|
if (!this._boundary) {
|
|
2148
2147
|
this._generateBoundary();
|
|
2149
2148
|
}
|
|
@@ -2151,60 +2150,55 @@ FormData.prototype.getBoundary = function() {
|
|
|
2151
2150
|
return this._boundary;
|
|
2152
2151
|
};
|
|
2153
2152
|
|
|
2154
|
-
FormData.prototype.getBuffer = function() {
|
|
2155
|
-
var dataBuffer = new Buffer.alloc(0);
|
|
2153
|
+
FormData.prototype.getBuffer = function () {
|
|
2154
|
+
var dataBuffer = new Buffer.alloc(0); // eslint-disable-line new-cap
|
|
2156
2155
|
var boundary = this.getBoundary();
|
|
2157
2156
|
|
|
2158
2157
|
// Create the form content. Add Line breaks to the end of data.
|
|
2159
2158
|
for (var i = 0, len = this._streams.length; i < len; i++) {
|
|
2160
2159
|
if (typeof this._streams[i] !== 'function') {
|
|
2161
|
-
|
|
2162
2160
|
// Add content to the buffer.
|
|
2163
|
-
if(Buffer.isBuffer(this._streams[i])) {
|
|
2164
|
-
dataBuffer = Buffer.concat(
|
|
2165
|
-
}else {
|
|
2166
|
-
dataBuffer = Buffer.concat(
|
|
2161
|
+
if (Buffer.isBuffer(this._streams[i])) {
|
|
2162
|
+
dataBuffer = Buffer.concat([dataBuffer, this._streams[i]]);
|
|
2163
|
+
} else {
|
|
2164
|
+
dataBuffer = Buffer.concat([dataBuffer, Buffer.from(this._streams[i])]);
|
|
2167
2165
|
}
|
|
2168
2166
|
|
|
2169
2167
|
// Add break after content.
|
|
2170
|
-
if (typeof this._streams[i] !== 'string' || this._streams[i].substring(
|
|
2171
|
-
dataBuffer = Buffer.concat(
|
|
2168
|
+
if (typeof this._streams[i] !== 'string' || this._streams[i].substring(2, boundary.length + 2) !== boundary) {
|
|
2169
|
+
dataBuffer = Buffer.concat([dataBuffer, Buffer.from(FormData.LINE_BREAK)]);
|
|
2172
2170
|
}
|
|
2173
2171
|
}
|
|
2174
2172
|
}
|
|
2175
2173
|
|
|
2176
2174
|
// Add the footer and return the Buffer object.
|
|
2177
|
-
return Buffer.concat(
|
|
2175
|
+
return Buffer.concat([dataBuffer, Buffer.from(this._lastBoundary())]);
|
|
2178
2176
|
};
|
|
2179
2177
|
|
|
2180
|
-
FormData.prototype._generateBoundary = function() {
|
|
2178
|
+
FormData.prototype._generateBoundary = function () {
|
|
2181
2179
|
// This generates a 50 character boundary similar to those used by Firefox.
|
|
2182
|
-
// They are optimized for boyer-moore parsing.
|
|
2183
|
-
var boundary = '--------------------------';
|
|
2184
|
-
for (var i = 0; i < 24; i++) {
|
|
2185
|
-
boundary += Math.floor(Math.random() * 10).toString(16);
|
|
2186
|
-
}
|
|
2187
2180
|
|
|
2188
|
-
|
|
2181
|
+
// They are optimized for boyer-moore parsing.
|
|
2182
|
+
this._boundary = '--------------------------' + crypto.randomBytes(12).toString('hex');
|
|
2189
2183
|
};
|
|
2190
2184
|
|
|
2191
2185
|
// Note: getLengthSync DOESN'T calculate streams length
|
|
2192
|
-
// As workaround one can calculate file size manually
|
|
2193
|
-
|
|
2194
|
-
FormData.prototype.getLengthSync = function() {
|
|
2186
|
+
// As workaround one can calculate file size manually and add it as knownLength option
|
|
2187
|
+
FormData.prototype.getLengthSync = function () {
|
|
2195
2188
|
var knownLength = this._overheadLength + this._valueLength;
|
|
2196
2189
|
|
|
2197
|
-
// Don't get confused, there are 3 "internal" streams for each keyval pair
|
|
2198
|
-
// so it basically checks if there is any value added to the form
|
|
2190
|
+
// Don't get confused, there are 3 "internal" streams for each keyval pair so it basically checks if there is any value added to the form
|
|
2199
2191
|
if (this._streams.length) {
|
|
2200
2192
|
knownLength += this._lastBoundary().length;
|
|
2201
2193
|
}
|
|
2202
2194
|
|
|
2203
2195
|
// https://github.com/form-data/form-data/issues/40
|
|
2204
2196
|
if (!this.hasKnownLength()) {
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2197
|
+
/*
|
|
2198
|
+
* Some async length retrievers are present
|
|
2199
|
+
* therefore synchronous length calculation is false.
|
|
2200
|
+
* Please use getLength(callback) to get proper length
|
|
2201
|
+
*/
|
|
2208
2202
|
this._error(new Error('Cannot calculate proper length in synchronous way.'));
|
|
2209
2203
|
}
|
|
2210
2204
|
|
|
@@ -2214,7 +2208,7 @@ FormData.prototype.getLengthSync = function() {
|
|
|
2214
2208
|
// Public API to check if length of added values is known
|
|
2215
2209
|
// https://github.com/form-data/form-data/issues/196
|
|
2216
2210
|
// https://github.com/form-data/form-data/issues/262
|
|
2217
|
-
FormData.prototype.hasKnownLength = function() {
|
|
2211
|
+
FormData.prototype.hasKnownLength = function () {
|
|
2218
2212
|
var hasKnownLength = true;
|
|
2219
2213
|
|
|
2220
2214
|
if (this._valuesToMeasure.length) {
|
|
@@ -2224,7 +2218,7 @@ FormData.prototype.hasKnownLength = function() {
|
|
|
2224
2218
|
return hasKnownLength;
|
|
2225
2219
|
};
|
|
2226
2220
|
|
|
2227
|
-
FormData.prototype.getLength = function(cb) {
|
|
2221
|
+
FormData.prototype.getLength = function (cb) {
|
|
2228
2222
|
var knownLength = this._overheadLength + this._valueLength;
|
|
2229
2223
|
|
|
2230
2224
|
if (this._streams.length) {
|
|
@@ -2236,13 +2230,13 @@ FormData.prototype.getLength = function(cb) {
|
|
|
2236
2230
|
return;
|
|
2237
2231
|
}
|
|
2238
2232
|
|
|
2239
|
-
asynckit.parallel(this._valuesToMeasure, this._lengthRetriever, function(err, values) {
|
|
2233
|
+
asynckit.parallel(this._valuesToMeasure, this._lengthRetriever, function (err, values) {
|
|
2240
2234
|
if (err) {
|
|
2241
2235
|
cb(err);
|
|
2242
2236
|
return;
|
|
2243
2237
|
}
|
|
2244
2238
|
|
|
2245
|
-
values.forEach(function(length) {
|
|
2239
|
+
values.forEach(function (length) {
|
|
2246
2240
|
knownLength += length;
|
|
2247
2241
|
});
|
|
2248
2242
|
|
|
@@ -2250,31 +2244,26 @@ FormData.prototype.getLength = function(cb) {
|
|
|
2250
2244
|
});
|
|
2251
2245
|
};
|
|
2252
2246
|
|
|
2253
|
-
FormData.prototype.submit = function(params, cb) {
|
|
2254
|
-
var request
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
;
|
|
2258
|
-
|
|
2259
|
-
// parse provided url if it's string
|
|
2260
|
-
// or treat it as options object
|
|
2261
|
-
if (typeof params == 'string') {
|
|
2247
|
+
FormData.prototype.submit = function (params, cb) {
|
|
2248
|
+
var request;
|
|
2249
|
+
var options;
|
|
2250
|
+
var defaults = { method: 'post' };
|
|
2262
2251
|
|
|
2263
|
-
|
|
2252
|
+
// parse provided url if it's string or treat it as options object
|
|
2253
|
+
if (typeof params === 'string') {
|
|
2254
|
+
params = parseUrl(params); // eslint-disable-line no-param-reassign
|
|
2255
|
+
/* eslint sort-keys: 0 */
|
|
2264
2256
|
options = populate({
|
|
2265
2257
|
port: params.port,
|
|
2266
2258
|
path: params.pathname,
|
|
2267
2259
|
host: params.hostname,
|
|
2268
2260
|
protocol: params.protocol
|
|
2269
2261
|
}, defaults);
|
|
2270
|
-
|
|
2271
|
-
// use custom params
|
|
2272
|
-
} else {
|
|
2273
|
-
|
|
2262
|
+
} else { // use custom params
|
|
2274
2263
|
options = populate(params, defaults);
|
|
2275
2264
|
// if no port provided use default one
|
|
2276
2265
|
if (!options.port) {
|
|
2277
|
-
options.port = options.protocol
|
|
2266
|
+
options.port = options.protocol === 'https:' ? 443 : 80;
|
|
2278
2267
|
}
|
|
2279
2268
|
}
|
|
2280
2269
|
|
|
@@ -2282,14 +2271,14 @@ FormData.prototype.submit = function(params, cb) {
|
|
|
2282
2271
|
options.headers = this.getHeaders(params.headers);
|
|
2283
2272
|
|
|
2284
2273
|
// https if specified, fallback to http in any other case
|
|
2285
|
-
if (options.protocol
|
|
2274
|
+
if (options.protocol === 'https:') {
|
|
2286
2275
|
request = https.request(options);
|
|
2287
2276
|
} else {
|
|
2288
2277
|
request = http.request(options);
|
|
2289
2278
|
}
|
|
2290
2279
|
|
|
2291
2280
|
// get content length and fire away
|
|
2292
|
-
this.getLength(function(err, length) {
|
|
2281
|
+
this.getLength(function (err, length) {
|
|
2293
2282
|
if (err && err !== 'Unknown stream') {
|
|
2294
2283
|
this._error(err);
|
|
2295
2284
|
return;
|
|
@@ -2308,7 +2297,7 @@ FormData.prototype.submit = function(params, cb) {
|
|
|
2308
2297
|
request.removeListener('error', callback);
|
|
2309
2298
|
request.removeListener('response', onResponse);
|
|
2310
2299
|
|
|
2311
|
-
return cb.call(this, error, responce);
|
|
2300
|
+
return cb.call(this, error, responce); // eslint-disable-line no-invalid-this
|
|
2312
2301
|
};
|
|
2313
2302
|
|
|
2314
2303
|
onResponse = callback.bind(this, null);
|
|
@@ -2321,7 +2310,7 @@ FormData.prototype.submit = function(params, cb) {
|
|
|
2321
2310
|
return request;
|
|
2322
2311
|
};
|
|
2323
2312
|
|
|
2324
|
-
FormData.prototype._error = function(err) {
|
|
2313
|
+
FormData.prototype._error = function (err) {
|
|
2325
2314
|
if (!this.error) {
|
|
2326
2315
|
this.error = err;
|
|
2327
2316
|
this.pause();
|
|
@@ -2334,6 +2323,9 @@ FormData.prototype.toString = function () {
|
|
|
2334
2323
|
};
|
|
2335
2324
|
setToStringTag(FormData, 'FormData');
|
|
2336
2325
|
|
|
2326
|
+
// Public API
|
|
2327
|
+
module.exports = FormData;
|
|
2328
|
+
|
|
2337
2329
|
|
|
2338
2330
|
/***/ }),
|
|
2339
2331
|
|
|
@@ -2746,12 +2738,13 @@ module.exports = function hasSymbols() {
|
|
|
2746
2738
|
/***/ 1362:
|
|
2747
2739
|
/***/ ((module) => {
|
|
2748
2740
|
|
|
2749
|
-
|
|
2750
|
-
module.exports = function(dst, src) {
|
|
2741
|
+
"use strict";
|
|
2751
2742
|
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2743
|
+
|
|
2744
|
+
// populates missing values
|
|
2745
|
+
module.exports = function (dst, src) {
|
|
2746
|
+
Object.keys(src).forEach(function (prop) {
|
|
2747
|
+
dst[prop] = dst[prop] || src[prop]; // eslint-disable-line no-param-reassign
|
|
2755
2748
|
});
|
|
2756
2749
|
|
|
2757
2750
|
return dst;
|
|
@@ -7999,6 +7992,9 @@ var _default = exports["default"] = {
|
|
|
7999
7992
|
},
|
|
8000
7993
|
NodeLocked: {
|
|
8001
7994
|
NAME: 'NodeLocked'
|
|
7995
|
+
},
|
|
7996
|
+
Discount: {
|
|
7997
|
+
NAME: 'Discount'
|
|
8002
7998
|
}
|
|
8003
7999
|
},
|
|
8004
8000
|
Vendor: {
|
|
@@ -8899,6 +8895,14 @@ module.exports = require("path");
|
|
|
8899
8895
|
|
|
8900
8896
|
/***/ }),
|
|
8901
8897
|
|
|
8898
|
+
/***/ 6982:
|
|
8899
|
+
/***/ ((module) => {
|
|
8900
|
+
|
|
8901
|
+
"use strict";
|
|
8902
|
+
module.exports = require("crypto");
|
|
8903
|
+
|
|
8904
|
+
/***/ }),
|
|
8905
|
+
|
|
8902
8906
|
/***/ 7016:
|
|
8903
8907
|
/***/ ((module) => {
|
|
8904
8908
|
|
|
@@ -10406,7 +10410,7 @@ DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() {
|
|
|
10406
10410
|
/***/ ((module) => {
|
|
10407
10411
|
|
|
10408
10412
|
"use strict";
|
|
10409
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"netlicensing-client","version":"1.2.
|
|
10413
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"netlicensing-client","version":"1.2.39","description":"JavaScript Wrapper for Labs64 NetLicensing RESTful API","keywords":["labs64","netlicensing","licensing","licensing-as-a-service","license","license-management","software-license","client","restful","restful-api","javascript","wrapper","api","client"],"license":"Apache-2.0","author":"Labs64 GmbH","homepage":"https://netlicensing.io","repository":{"type":"git","url":"https://github.com/Labs64/NetLicensingClient-javascript"},"bugs":{"url":"https://github.com/Labs64/NetLicensingClient-javascript/issues"},"contributors":[{"name":"Ready Brown","email":"ready.brown@hotmail.de","url":"https://github.com/r-brown"},{"name":"Viacheslav Rudkovskiy","email":"viachaslau.rudkovski@labs64.de","url":"https://github.com/v-rudkovskiy"},{"name":"Andrei Yushkevich","email":"yushkevich@me.com","url":"https://github.com/yushkevich"}],"main":"dist/netlicensing-client.js","files":["dist"],"scripts":{"build":"node build/build.cjs","release":"npm run build && npm run test","dev":"webpack --progress --watch --config build/webpack.dev.conf.cjs","test":"karma start test/karma.conf.js --single-run","test-mocha":"webpack --config build/webpack.test.conf.cjs","test-for-travis":"karma start test/karma.conf.js --single-run --browsers Firefox","lint":"eslint --ext .js,.vue src test"},"dependencies":{"axios":"^1.8.2","btoa":"^1.2.1","es6-promise":"^4.2.8"},"devDependencies":{"@babel/core":"^7.26.9","@babel/plugin-proposal-class-properties":"^7.16.7","@babel/plugin-proposal-decorators":"^7.25.9","@babel/plugin-proposal-export-namespace-from":"^7.16.7","@babel/plugin-proposal-function-sent":"^7.25.9","@babel/plugin-proposal-json-strings":"^7.16.7","@babel/plugin-proposal-numeric-separator":"^7.16.7","@babel/plugin-proposal-throw-expressions":"^7.25.9","@babel/plugin-syntax-dynamic-import":"^7.8.3","@babel/plugin-syntax-import-meta":"^7.10.4","@babel/plugin-transform-modules-commonjs":"^7.26.3","@babel/plugin-transform-runtime":"^7.26.9","@babel/preset-env":"^7.26.9","@babel/runtime":"^7.26.9","axios-mock-adapter":"^2.1.0","babel-eslint":"^10.1.0","babel-loader":"^9.2.1","chalk":"^4.1.2","eslint":"^8.2.0","eslint-config-airbnb-base":"^15.0.0","eslint-friendly-formatter":"^4.0.1","eslint-import-resolver-webpack":"^0.13.10","eslint-plugin-import":"^2.31.0","eslint-plugin-jasmine":"^4.2.2","eslint-webpack-plugin":"^4.2.0","faker":"^5.5.3","is-docker":"^2.2.1","jasmine":"^4.0.2","jasmine-core":"^4.0.1","karma":"^6.3.17","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.2","karma-jasmine":"^4.0.2","karma-sourcemap-loader":"^0.3.7","karma-spec-reporter":"0.0.33","karma-webpack":"^5.0.0","lodash":"^4.17.21","ora":"^5.4.1","rimraf":"^3.0.2","terser-webpack-plugin":"^5.3.1","webpack":"^5.76.0","webpack-cli":"^5.1.1","webpack-merge":"^5.8.0"},"engines":{"node":">= 14.0.0","npm":">= 8.0.0"},"browserslist":["> 1%","last 2 versions","not ie <= 10"]}');
|
|
10410
10414
|
|
|
10411
10415
|
/***/ }),
|
|
10412
10416
|
|
|
@@ -11232,10 +11236,11 @@ module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exp
|
|
|
11232
11236
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
11233
11237
|
|
|
11234
11238
|
"use strict";
|
|
11235
|
-
|
|
11239
|
+
/*! Axios v1.8.2 Copyright (c) 2025 Matt Zabriskie and contributors */
|
|
11236
11240
|
|
|
11237
11241
|
|
|
11238
11242
|
const FormData$1 = __webpack_require__(737);
|
|
11243
|
+
const crypto = __webpack_require__(6982);
|
|
11239
11244
|
const url = __webpack_require__(7016);
|
|
11240
11245
|
const proxyFromEnv = __webpack_require__(6504);
|
|
11241
11246
|
const http = __webpack_require__(8611);
|
|
@@ -11249,6 +11254,7 @@ const events = __webpack_require__(4434);
|
|
|
11249
11254
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
11250
11255
|
|
|
11251
11256
|
const FormData__default = /*#__PURE__*/_interopDefaultLegacy(FormData$1);
|
|
11257
|
+
const crypto__default = /*#__PURE__*/_interopDefaultLegacy(crypto);
|
|
11252
11258
|
const url__default = /*#__PURE__*/_interopDefaultLegacy(url);
|
|
11253
11259
|
const proxyFromEnv__default = /*#__PURE__*/_interopDefaultLegacy(proxyFromEnv);
|
|
11254
11260
|
const http__default = /*#__PURE__*/_interopDefaultLegacy(http);
|
|
@@ -11864,26 +11870,6 @@ const toFiniteNumber = (value, defaultValue) => {
|
|
|
11864
11870
|
return value != null && Number.isFinite(value = +value) ? value : defaultValue;
|
|
11865
11871
|
};
|
|
11866
11872
|
|
|
11867
|
-
const ALPHA = 'abcdefghijklmnopqrstuvwxyz';
|
|
11868
|
-
|
|
11869
|
-
const DIGIT = '0123456789';
|
|
11870
|
-
|
|
11871
|
-
const ALPHABET = {
|
|
11872
|
-
DIGIT,
|
|
11873
|
-
ALPHA,
|
|
11874
|
-
ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
|
|
11875
|
-
};
|
|
11876
|
-
|
|
11877
|
-
const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
|
|
11878
|
-
let str = '';
|
|
11879
|
-
const {length} = alphabet;
|
|
11880
|
-
while (size--) {
|
|
11881
|
-
str += alphabet[Math.random() * length|0];
|
|
11882
|
-
}
|
|
11883
|
-
|
|
11884
|
-
return str;
|
|
11885
|
-
};
|
|
11886
|
-
|
|
11887
11873
|
/**
|
|
11888
11874
|
* If the thing is a FormData object, return true, otherwise return false.
|
|
11889
11875
|
*
|
|
@@ -12011,8 +11997,6 @@ const utils$1 = {
|
|
|
12011
11997
|
findKey,
|
|
12012
11998
|
global: _global,
|
|
12013
11999
|
isContextDefined,
|
|
12014
|
-
ALPHABET,
|
|
12015
|
-
generateString,
|
|
12016
12000
|
isSpecCompliantForm,
|
|
12017
12001
|
toJSONObject,
|
|
12018
12002
|
isAsyncFn,
|
|
@@ -12524,6 +12508,29 @@ const transitionalDefaults = {
|
|
|
12524
12508
|
|
|
12525
12509
|
const URLSearchParams = url__default["default"].URLSearchParams;
|
|
12526
12510
|
|
|
12511
|
+
const ALPHA = 'abcdefghijklmnopqrstuvwxyz';
|
|
12512
|
+
|
|
12513
|
+
const DIGIT = '0123456789';
|
|
12514
|
+
|
|
12515
|
+
const ALPHABET = {
|
|
12516
|
+
DIGIT,
|
|
12517
|
+
ALPHA,
|
|
12518
|
+
ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
|
|
12519
|
+
};
|
|
12520
|
+
|
|
12521
|
+
const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
|
|
12522
|
+
let str = '';
|
|
12523
|
+
const {length} = alphabet;
|
|
12524
|
+
const randomValues = new Uint32Array(size);
|
|
12525
|
+
crypto__default["default"].randomFillSync(randomValues);
|
|
12526
|
+
for (let i = 0; i < size; i++) {
|
|
12527
|
+
str += alphabet[randomValues[i] % length];
|
|
12528
|
+
}
|
|
12529
|
+
|
|
12530
|
+
return str;
|
|
12531
|
+
};
|
|
12532
|
+
|
|
12533
|
+
|
|
12527
12534
|
const platform$1 = {
|
|
12528
12535
|
isNode: true,
|
|
12529
12536
|
classes: {
|
|
@@ -12531,6 +12538,8 @@ const platform$1 = {
|
|
|
12531
12538
|
FormData: FormData__default["default"],
|
|
12532
12539
|
Blob: typeof Blob !== 'undefined' && Blob || null
|
|
12533
12540
|
},
|
|
12541
|
+
ALPHABET,
|
|
12542
|
+
generateString,
|
|
12534
12543
|
protocols: [ 'http', 'https', 'file', 'data' ]
|
|
12535
12544
|
};
|
|
12536
12545
|
|
|
@@ -13305,14 +13314,15 @@ function combineURLs(baseURL, relativeURL) {
|
|
|
13305
13314
|
*
|
|
13306
13315
|
* @returns {string} The combined full path
|
|
13307
13316
|
*/
|
|
13308
|
-
function buildFullPath(baseURL, requestedURL) {
|
|
13309
|
-
|
|
13317
|
+
function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
|
|
13318
|
+
let isRelativeUrl = !isAbsoluteURL(requestedURL);
|
|
13319
|
+
if (baseURL && isRelativeUrl || allowAbsoluteUrls == false) {
|
|
13310
13320
|
return combineURLs(baseURL, requestedURL);
|
|
13311
13321
|
}
|
|
13312
13322
|
return requestedURL;
|
|
13313
13323
|
}
|
|
13314
13324
|
|
|
13315
|
-
const VERSION = "1.
|
|
13325
|
+
const VERSION = "1.8.2";
|
|
13316
13326
|
|
|
13317
13327
|
function parseProtocol(url) {
|
|
13318
13328
|
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
|
|
@@ -13522,7 +13532,7 @@ const readBlob = async function* (blob) {
|
|
|
13522
13532
|
|
|
13523
13533
|
const readBlob$1 = readBlob;
|
|
13524
13534
|
|
|
13525
|
-
const BOUNDARY_ALPHABET =
|
|
13535
|
+
const BOUNDARY_ALPHABET = platform.ALPHABET.ALPHA_DIGIT + '-_';
|
|
13526
13536
|
|
|
13527
13537
|
const textEncoder = typeof TextEncoder === 'function' ? new TextEncoder() : new util__default["default"].TextEncoder();
|
|
13528
13538
|
|
|
@@ -13582,7 +13592,7 @@ const formDataToStream = (form, headersHandler, options) => {
|
|
|
13582
13592
|
const {
|
|
13583
13593
|
tag = 'form-data-boundary',
|
|
13584
13594
|
size = 25,
|
|
13585
|
-
boundary = tag + '-' +
|
|
13595
|
+
boundary = tag + '-' + platform.generateString(size, BOUNDARY_ALPHABET)
|
|
13586
13596
|
} = options || {};
|
|
13587
13597
|
|
|
13588
13598
|
if(!utils$1.isFormData(form)) {
|
|
@@ -14007,7 +14017,7 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
14007
14017
|
}
|
|
14008
14018
|
|
|
14009
14019
|
// Parse url
|
|
14010
|
-
const fullPath = buildFullPath(config.baseURL, config.url);
|
|
14020
|
+
const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
|
|
14011
14021
|
const parsed = new URL(fullPath, platform.hasBrowserEnv ? platform.origin : undefined);
|
|
14012
14022
|
const protocol = parsed.protocol || supportedProtocols[0];
|
|
14013
14023
|
|
|
@@ -15538,6 +15548,13 @@ class Axios {
|
|
|
15538
15548
|
}
|
|
15539
15549
|
}
|
|
15540
15550
|
|
|
15551
|
+
// Set config.allowAbsoluteUrls
|
|
15552
|
+
if (config.allowAbsoluteUrls !== undefined) ; else if (this.defaults.allowAbsoluteUrls !== undefined) {
|
|
15553
|
+
config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
|
|
15554
|
+
} else {
|
|
15555
|
+
config.allowAbsoluteUrls = true;
|
|
15556
|
+
}
|
|
15557
|
+
|
|
15541
15558
|
validator.assertOptions(config, {
|
|
15542
15559
|
baseUrl: validators.spelling('baseURL'),
|
|
15543
15560
|
withXsrfToken: validators.spelling('withXSRFToken')
|
|
@@ -15633,7 +15650,7 @@ class Axios {
|
|
|
15633
15650
|
|
|
15634
15651
|
getUri(config) {
|
|
15635
15652
|
config = mergeConfig(this.defaults, config);
|
|
15636
|
-
const fullPath = buildFullPath(config.baseURL, config.url);
|
|
15653
|
+
const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
|
|
15637
15654
|
return buildURL(fullPath, config.params, config.paramsSerializer);
|
|
15638
15655
|
}
|
|
15639
15656
|
}
|