contentful-management 11.55.0-canary.1 → 11.55.0-canary.2
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/contentful-management.browser.js +69 -34
- package/dist/contentful-management.browser.js.map +1 -1
- package/dist/contentful-management.browser.min.js +1 -1
- package/dist/contentful-management.node.js +258 -161
- package/dist/contentful-management.node.js.map +1 -1
- package/dist/contentful-management.node.min.js +1 -1
- package/dist/es-modules/contentful-management.js +1 -1
- package/package.json +2 -2
|
@@ -20128,6 +20128,52 @@ module.exports = URIError;
|
|
|
20128
20128
|
module.exports = Object;
|
|
20129
20129
|
|
|
20130
20130
|
|
|
20131
|
+
/***/ }),
|
|
20132
|
+
|
|
20133
|
+
/***/ "../node_modules/es-set-tostringtag/index.js":
|
|
20134
|
+
/*!***************************************************!*\
|
|
20135
|
+
!*** ../node_modules/es-set-tostringtag/index.js ***!
|
|
20136
|
+
\***************************************************/
|
|
20137
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
20138
|
+
|
|
20139
|
+
"use strict";
|
|
20140
|
+
|
|
20141
|
+
|
|
20142
|
+
var GetIntrinsic = __webpack_require__(/*! get-intrinsic */ "../node_modules/get-intrinsic/index.js");
|
|
20143
|
+
|
|
20144
|
+
var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
|
|
20145
|
+
|
|
20146
|
+
var hasToStringTag = __webpack_require__(/*! has-tostringtag/shams */ "../node_modules/has-tostringtag/shams.js")();
|
|
20147
|
+
var hasOwn = __webpack_require__(/*! hasown */ "../node_modules/hasown/index.js");
|
|
20148
|
+
var $TypeError = __webpack_require__(/*! es-errors/type */ "../node_modules/es-errors/type.js");
|
|
20149
|
+
|
|
20150
|
+
var toStringTag = hasToStringTag ? Symbol.toStringTag : null;
|
|
20151
|
+
|
|
20152
|
+
/** @type {import('.')} */
|
|
20153
|
+
module.exports = function setToStringTag(object, value) {
|
|
20154
|
+
var overrideIfSet = arguments.length > 2 && !!arguments[2] && arguments[2].force;
|
|
20155
|
+
var nonConfigurable = arguments.length > 2 && !!arguments[2] && arguments[2].nonConfigurable;
|
|
20156
|
+
if (
|
|
20157
|
+
(typeof overrideIfSet !== 'undefined' && typeof overrideIfSet !== 'boolean')
|
|
20158
|
+
|| (typeof nonConfigurable !== 'undefined' && typeof nonConfigurable !== 'boolean')
|
|
20159
|
+
) {
|
|
20160
|
+
throw new $TypeError('if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans');
|
|
20161
|
+
}
|
|
20162
|
+
if (toStringTag && (overrideIfSet || !hasOwn(object, toStringTag))) {
|
|
20163
|
+
if ($defineProperty) {
|
|
20164
|
+
$defineProperty(object, toStringTag, {
|
|
20165
|
+
configurable: !nonConfigurable,
|
|
20166
|
+
enumerable: false,
|
|
20167
|
+
value: value,
|
|
20168
|
+
writable: false
|
|
20169
|
+
});
|
|
20170
|
+
} else {
|
|
20171
|
+
object[toStringTag] = value; // eslint-disable-line no-param-reassign
|
|
20172
|
+
}
|
|
20173
|
+
}
|
|
20174
|
+
};
|
|
20175
|
+
|
|
20176
|
+
|
|
20131
20177
|
/***/ }),
|
|
20132
20178
|
|
|
20133
20179
|
/***/ "../node_modules/follow-redirects/debug.js":
|
|
@@ -20857,6 +20903,9 @@ module.exports.wrap = wrap;
|
|
|
20857
20903
|
\**************************************************/
|
|
20858
20904
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
20859
20905
|
|
|
20906
|
+
"use strict";
|
|
20907
|
+
|
|
20908
|
+
|
|
20860
20909
|
var CombinedStream = __webpack_require__(/*! combined-stream */ "../node_modules/combined-stream/lib/combined_stream.js");
|
|
20861
20910
|
var util = __webpack_require__(/*! util */ "util");
|
|
20862
20911
|
var path = __webpack_require__(/*! path */ "path");
|
|
@@ -20865,23 +20914,20 @@ var https = __webpack_require__(/*! https */ "https");
|
|
|
20865
20914
|
var parseUrl = (__webpack_require__(/*! url */ "url").parse);
|
|
20866
20915
|
var fs = __webpack_require__(/*! fs */ "fs");
|
|
20867
20916
|
var Stream = (__webpack_require__(/*! stream */ "stream").Stream);
|
|
20917
|
+
var crypto = __webpack_require__(/*! crypto */ "crypto");
|
|
20868
20918
|
var mime = __webpack_require__(/*! mime-types */ "../node_modules/mime-types/index.js");
|
|
20869
20919
|
var asynckit = __webpack_require__(/*! asynckit */ "../node_modules/asynckit/index.js");
|
|
20920
|
+
var setToStringTag = __webpack_require__(/*! es-set-tostringtag */ "../node_modules/es-set-tostringtag/index.js");
|
|
20921
|
+
var hasOwn = __webpack_require__(/*! hasown */ "../node_modules/hasown/index.js");
|
|
20870
20922
|
var populate = __webpack_require__(/*! ./populate.js */ "../node_modules/form-data/lib/populate.js");
|
|
20871
20923
|
|
|
20872
|
-
// Public API
|
|
20873
|
-
module.exports = FormData;
|
|
20874
|
-
|
|
20875
|
-
// make it a Stream
|
|
20876
|
-
util.inherits(FormData, CombinedStream);
|
|
20877
|
-
|
|
20878
20924
|
/**
|
|
20879
20925
|
* Create readable "multipart/form-data" streams.
|
|
20880
20926
|
* Can be used to submit forms
|
|
20881
20927
|
* and file uploads to other web applications.
|
|
20882
20928
|
*
|
|
20883
20929
|
* @constructor
|
|
20884
|
-
* @param {
|
|
20930
|
+
* @param {object} options - Properties to be added/overriden for FormData and CombinedStream
|
|
20885
20931
|
*/
|
|
20886
20932
|
function FormData(options) {
|
|
20887
20933
|
if (!(this instanceof FormData)) {
|
|
@@ -20894,35 +20940,39 @@ function FormData(options) {
|
|
|
20894
20940
|
|
|
20895
20941
|
CombinedStream.call(this);
|
|
20896
20942
|
|
|
20897
|
-
options = options || {};
|
|
20898
|
-
for (var option in options) {
|
|
20943
|
+
options = options || {}; // eslint-disable-line no-param-reassign
|
|
20944
|
+
for (var option in options) { // eslint-disable-line no-restricted-syntax
|
|
20899
20945
|
this[option] = options[option];
|
|
20900
20946
|
}
|
|
20901
20947
|
}
|
|
20902
20948
|
|
|
20949
|
+
// make it a Stream
|
|
20950
|
+
util.inherits(FormData, CombinedStream);
|
|
20951
|
+
|
|
20903
20952
|
FormData.LINE_BREAK = '\r\n';
|
|
20904
20953
|
FormData.DEFAULT_CONTENT_TYPE = 'application/octet-stream';
|
|
20905
20954
|
|
|
20906
|
-
FormData.prototype.append = function(field, value, options) {
|
|
20907
|
-
|
|
20908
|
-
options = options || {};
|
|
20955
|
+
FormData.prototype.append = function (field, value, options) {
|
|
20956
|
+
options = options || {}; // eslint-disable-line no-param-reassign
|
|
20909
20957
|
|
|
20910
20958
|
// allow filename as single option
|
|
20911
|
-
if (typeof options
|
|
20912
|
-
options = {filename: options};
|
|
20959
|
+
if (typeof options === 'string') {
|
|
20960
|
+
options = { filename: options }; // eslint-disable-line no-param-reassign
|
|
20913
20961
|
}
|
|
20914
20962
|
|
|
20915
20963
|
var append = CombinedStream.prototype.append.bind(this);
|
|
20916
20964
|
|
|
20917
20965
|
// all that streamy business can't handle numbers
|
|
20918
|
-
if (typeof value
|
|
20919
|
-
value =
|
|
20966
|
+
if (typeof value === 'number' || value == null) {
|
|
20967
|
+
value = String(value); // eslint-disable-line no-param-reassign
|
|
20920
20968
|
}
|
|
20921
20969
|
|
|
20922
20970
|
// https://github.com/felixge/node-form-data/issues/38
|
|
20923
20971
|
if (Array.isArray(value)) {
|
|
20924
|
-
|
|
20925
|
-
|
|
20972
|
+
/*
|
|
20973
|
+
* Please convert your array into string
|
|
20974
|
+
* the way web server expects it
|
|
20975
|
+
*/
|
|
20926
20976
|
this._error(new Error('Arrays are not supported.'));
|
|
20927
20977
|
return;
|
|
20928
20978
|
}
|
|
@@ -20938,15 +20988,17 @@ FormData.prototype.append = function(field, value, options) {
|
|
|
20938
20988
|
this._trackLength(header, value, options);
|
|
20939
20989
|
};
|
|
20940
20990
|
|
|
20941
|
-
FormData.prototype._trackLength = function(header, value, options) {
|
|
20991
|
+
FormData.prototype._trackLength = function (header, value, options) {
|
|
20942
20992
|
var valueLength = 0;
|
|
20943
20993
|
|
|
20944
|
-
|
|
20945
|
-
|
|
20946
|
-
|
|
20947
|
-
|
|
20994
|
+
/*
|
|
20995
|
+
* used w/ getLengthSync(), when length is known.
|
|
20996
|
+
* e.g. for streaming directly from a remote server,
|
|
20997
|
+
* w/ a known file a size, and not wanting to wait for
|
|
20998
|
+
* incoming file to finish to get its size.
|
|
20999
|
+
*/
|
|
20948
21000
|
if (options.knownLength != null) {
|
|
20949
|
-
valueLength +=
|
|
21001
|
+
valueLength += Number(options.knownLength);
|
|
20950
21002
|
} else if (Buffer.isBuffer(value)) {
|
|
20951
21003
|
valueLength = value.length;
|
|
20952
21004
|
} else if (typeof value === 'string') {
|
|
@@ -20956,12 +21008,10 @@ FormData.prototype._trackLength = function(header, value, options) {
|
|
|
20956
21008
|
this._valueLength += valueLength;
|
|
20957
21009
|
|
|
20958
21010
|
// @check why add CRLF? does this account for custom/multiple CRLFs?
|
|
20959
|
-
this._overheadLength +=
|
|
20960
|
-
Buffer.byteLength(header) +
|
|
20961
|
-
FormData.LINE_BREAK.length;
|
|
21011
|
+
this._overheadLength += Buffer.byteLength(header) + FormData.LINE_BREAK.length;
|
|
20962
21012
|
|
|
20963
21013
|
// empty or either doesn't have path or not an http response or not a stream
|
|
20964
|
-
if (!value || (
|
|
21014
|
+
if (!value || (!value.path && !(value.readable && hasOwn(value, 'httpVersion')) && !(value instanceof Stream))) {
|
|
20965
21015
|
return;
|
|
20966
21016
|
}
|
|
20967
21017
|
|
|
@@ -20971,10 +21021,8 @@ FormData.prototype._trackLength = function(header, value, options) {
|
|
|
20971
21021
|
}
|
|
20972
21022
|
};
|
|
20973
21023
|
|
|
20974
|
-
FormData.prototype._lengthRetriever = function(value, callback) {
|
|
20975
|
-
|
|
20976
|
-
if (value.hasOwnProperty('fd')) {
|
|
20977
|
-
|
|
21024
|
+
FormData.prototype._lengthRetriever = function (value, callback) {
|
|
21025
|
+
if (hasOwn(value, 'fd')) {
|
|
20978
21026
|
// take read range into a account
|
|
20979
21027
|
// `end` = Infinity –> read file till the end
|
|
20980
21028
|
//
|
|
@@ -20983,54 +21031,52 @@ FormData.prototype._lengthRetriever = function(value, callback) {
|
|
|
20983
21031
|
// Fix it when node fixes it.
|
|
20984
21032
|
// https://github.com/joyent/node/issues/7819
|
|
20985
21033
|
if (value.end != undefined && value.end != Infinity && value.start != undefined) {
|
|
20986
|
-
|
|
20987
21034
|
// when end specified
|
|
20988
21035
|
// no need to calculate range
|
|
20989
21036
|
// inclusive, starts with 0
|
|
20990
|
-
callback(null, value.end + 1 - (value.start ? value.start : 0));
|
|
21037
|
+
callback(null, value.end + 1 - (value.start ? value.start : 0)); // eslint-disable-line callback-return
|
|
20991
21038
|
|
|
20992
|
-
|
|
21039
|
+
// not that fast snoopy
|
|
20993
21040
|
} else {
|
|
20994
21041
|
// still need to fetch file size from fs
|
|
20995
|
-
fs.stat(value.path, function(err, stat) {
|
|
20996
|
-
|
|
20997
|
-
var fileSize;
|
|
20998
|
-
|
|
21042
|
+
fs.stat(value.path, function (err, stat) {
|
|
20999
21043
|
if (err) {
|
|
21000
21044
|
callback(err);
|
|
21001
21045
|
return;
|
|
21002
21046
|
}
|
|
21003
21047
|
|
|
21004
21048
|
// update final size based on the range options
|
|
21005
|
-
fileSize = stat.size - (value.start ? value.start : 0);
|
|
21049
|
+
var fileSize = stat.size - (value.start ? value.start : 0);
|
|
21006
21050
|
callback(null, fileSize);
|
|
21007
21051
|
});
|
|
21008
21052
|
}
|
|
21009
21053
|
|
|
21010
|
-
|
|
21011
|
-
} else if (value
|
|
21012
|
-
callback(null,
|
|
21054
|
+
// or http response
|
|
21055
|
+
} else if (hasOwn(value, 'httpVersion')) {
|
|
21056
|
+
callback(null, Number(value.headers['content-length'])); // eslint-disable-line callback-return
|
|
21013
21057
|
|
|
21014
|
-
|
|
21015
|
-
} else if (value
|
|
21058
|
+
// or request stream http://github.com/mikeal/request
|
|
21059
|
+
} else if (hasOwn(value, 'httpModule')) {
|
|
21016
21060
|
// wait till response come back
|
|
21017
|
-
value.on('response', function(response) {
|
|
21061
|
+
value.on('response', function (response) {
|
|
21018
21062
|
value.pause();
|
|
21019
|
-
callback(null,
|
|
21063
|
+
callback(null, Number(response.headers['content-length']));
|
|
21020
21064
|
});
|
|
21021
21065
|
value.resume();
|
|
21022
21066
|
|
|
21023
|
-
|
|
21067
|
+
// something else
|
|
21024
21068
|
} else {
|
|
21025
|
-
callback('Unknown stream');
|
|
21069
|
+
callback('Unknown stream'); // eslint-disable-line callback-return
|
|
21026
21070
|
}
|
|
21027
21071
|
};
|
|
21028
21072
|
|
|
21029
|
-
FormData.prototype._multiPartHeader = function(field, value, options) {
|
|
21030
|
-
|
|
21031
|
-
|
|
21032
|
-
|
|
21033
|
-
|
|
21073
|
+
FormData.prototype._multiPartHeader = function (field, value, options) {
|
|
21074
|
+
/*
|
|
21075
|
+
* custom header specified (as string)?
|
|
21076
|
+
* it becomes responsible for boundary
|
|
21077
|
+
* (e.g. to handle extra CRLFs on .NET servers)
|
|
21078
|
+
*/
|
|
21079
|
+
if (typeof options.header === 'string') {
|
|
21034
21080
|
return options.header;
|
|
21035
21081
|
}
|
|
21036
21082
|
|
|
@@ -21038,7 +21084,7 @@ FormData.prototype._multiPartHeader = function(field, value, options) {
|
|
|
21038
21084
|
var contentType = this._getContentType(value, options);
|
|
21039
21085
|
|
|
21040
21086
|
var contents = '';
|
|
21041
|
-
var headers
|
|
21087
|
+
var headers = {
|
|
21042
21088
|
// add custom disposition as third element or keep it two elements if not
|
|
21043
21089
|
'Content-Disposition': ['form-data', 'name="' + field + '"'].concat(contentDisposition || []),
|
|
21044
21090
|
// if no content type. allow it to be empty array
|
|
@@ -21046,77 +21092,74 @@ FormData.prototype._multiPartHeader = function(field, value, options) {
|
|
|
21046
21092
|
};
|
|
21047
21093
|
|
|
21048
21094
|
// allow custom headers.
|
|
21049
|
-
if (typeof options.header
|
|
21095
|
+
if (typeof options.header === 'object') {
|
|
21050
21096
|
populate(headers, options.header);
|
|
21051
21097
|
}
|
|
21052
21098
|
|
|
21053
21099
|
var header;
|
|
21054
|
-
for (var prop in headers) {
|
|
21055
|
-
if (
|
|
21056
|
-
|
|
21100
|
+
for (var prop in headers) { // eslint-disable-line no-restricted-syntax
|
|
21101
|
+
if (hasOwn(headers, prop)) {
|
|
21102
|
+
header = headers[prop];
|
|
21057
21103
|
|
|
21058
|
-
|
|
21059
|
-
|
|
21060
|
-
|
|
21061
|
-
|
|
21104
|
+
// skip nullish headers.
|
|
21105
|
+
if (header == null) {
|
|
21106
|
+
continue; // eslint-disable-line no-restricted-syntax, no-continue
|
|
21107
|
+
}
|
|
21062
21108
|
|
|
21063
|
-
|
|
21064
|
-
|
|
21065
|
-
|
|
21066
|
-
|
|
21109
|
+
// convert all headers to arrays.
|
|
21110
|
+
if (!Array.isArray(header)) {
|
|
21111
|
+
header = [header];
|
|
21112
|
+
}
|
|
21067
21113
|
|
|
21068
|
-
|
|
21069
|
-
|
|
21070
|
-
|
|
21114
|
+
// add non-empty headers.
|
|
21115
|
+
if (header.length) {
|
|
21116
|
+
contents += prop + ': ' + header.join('; ') + FormData.LINE_BREAK;
|
|
21117
|
+
}
|
|
21071
21118
|
}
|
|
21072
21119
|
}
|
|
21073
21120
|
|
|
21074
21121
|
return '--' + this.getBoundary() + FormData.LINE_BREAK + contents + FormData.LINE_BREAK;
|
|
21075
21122
|
};
|
|
21076
21123
|
|
|
21077
|
-
FormData.prototype._getContentDisposition = function(value, options) {
|
|
21078
|
-
|
|
21079
|
-
var filename
|
|
21080
|
-
, contentDisposition
|
|
21081
|
-
;
|
|
21124
|
+
FormData.prototype._getContentDisposition = function (value, options) { // eslint-disable-line consistent-return
|
|
21125
|
+
var filename;
|
|
21082
21126
|
|
|
21083
21127
|
if (typeof options.filepath === 'string') {
|
|
21084
21128
|
// custom filepath for relative paths
|
|
21085
21129
|
filename = path.normalize(options.filepath).replace(/\\/g, '/');
|
|
21086
|
-
} else if (options.filename || value.name || value.path) {
|
|
21087
|
-
|
|
21088
|
-
|
|
21089
|
-
|
|
21090
|
-
|
|
21091
|
-
|
|
21130
|
+
} else if (options.filename || (value && (value.name || value.path))) {
|
|
21131
|
+
/*
|
|
21132
|
+
* custom filename take precedence
|
|
21133
|
+
* formidable and the browser add a name property
|
|
21134
|
+
* fs- and request- streams have path property
|
|
21135
|
+
*/
|
|
21136
|
+
filename = path.basename(options.filename || (value && (value.name || value.path)));
|
|
21137
|
+
} else if (value && value.readable && hasOwn(value, 'httpVersion')) {
|
|
21092
21138
|
// or try http response
|
|
21093
21139
|
filename = path.basename(value.client._httpMessage.path || '');
|
|
21094
21140
|
}
|
|
21095
21141
|
|
|
21096
21142
|
if (filename) {
|
|
21097
|
-
|
|
21143
|
+
return 'filename="' + filename + '"';
|
|
21098
21144
|
}
|
|
21099
|
-
|
|
21100
|
-
return contentDisposition;
|
|
21101
21145
|
};
|
|
21102
21146
|
|
|
21103
|
-
FormData.prototype._getContentType = function(value, options) {
|
|
21104
|
-
|
|
21147
|
+
FormData.prototype._getContentType = function (value, options) {
|
|
21105
21148
|
// use custom content-type above all
|
|
21106
21149
|
var contentType = options.contentType;
|
|
21107
21150
|
|
|
21108
21151
|
// or try `name` from formidable, browser
|
|
21109
|
-
if (!contentType && value.name) {
|
|
21152
|
+
if (!contentType && value && value.name) {
|
|
21110
21153
|
contentType = mime.lookup(value.name);
|
|
21111
21154
|
}
|
|
21112
21155
|
|
|
21113
21156
|
// or try `path` from fs-, request- streams
|
|
21114
|
-
if (!contentType && value.path) {
|
|
21157
|
+
if (!contentType && value && value.path) {
|
|
21115
21158
|
contentType = mime.lookup(value.path);
|
|
21116
21159
|
}
|
|
21117
21160
|
|
|
21118
21161
|
// or if it's http-reponse
|
|
21119
|
-
if (!contentType && value.readable && value
|
|
21162
|
+
if (!contentType && value && value.readable && hasOwn(value, 'httpVersion')) {
|
|
21120
21163
|
contentType = value.headers['content-type'];
|
|
21121
21164
|
}
|
|
21122
21165
|
|
|
@@ -21126,18 +21169,18 @@ FormData.prototype._getContentType = function(value, options) {
|
|
|
21126
21169
|
}
|
|
21127
21170
|
|
|
21128
21171
|
// fallback to the default content type if `value` is not simple value
|
|
21129
|
-
if (!contentType && typeof value
|
|
21172
|
+
if (!contentType && value && typeof value === 'object') {
|
|
21130
21173
|
contentType = FormData.DEFAULT_CONTENT_TYPE;
|
|
21131
21174
|
}
|
|
21132
21175
|
|
|
21133
21176
|
return contentType;
|
|
21134
21177
|
};
|
|
21135
21178
|
|
|
21136
|
-
FormData.prototype._multiPartFooter = function() {
|
|
21137
|
-
return function(next) {
|
|
21179
|
+
FormData.prototype._multiPartFooter = function () {
|
|
21180
|
+
return function (next) {
|
|
21138
21181
|
var footer = FormData.LINE_BREAK;
|
|
21139
21182
|
|
|
21140
|
-
var lastPart =
|
|
21183
|
+
var lastPart = this._streams.length === 0;
|
|
21141
21184
|
if (lastPart) {
|
|
21142
21185
|
footer += this._lastBoundary();
|
|
21143
21186
|
}
|
|
@@ -21146,18 +21189,18 @@ FormData.prototype._multiPartFooter = function() {
|
|
|
21146
21189
|
}.bind(this);
|
|
21147
21190
|
};
|
|
21148
21191
|
|
|
21149
|
-
FormData.prototype._lastBoundary = function() {
|
|
21192
|
+
FormData.prototype._lastBoundary = function () {
|
|
21150
21193
|
return '--' + this.getBoundary() + '--' + FormData.LINE_BREAK;
|
|
21151
21194
|
};
|
|
21152
21195
|
|
|
21153
|
-
FormData.prototype.getHeaders = function(userHeaders) {
|
|
21196
|
+
FormData.prototype.getHeaders = function (userHeaders) {
|
|
21154
21197
|
var header;
|
|
21155
21198
|
var formHeaders = {
|
|
21156
21199
|
'content-type': 'multipart/form-data; boundary=' + this.getBoundary()
|
|
21157
21200
|
};
|
|
21158
21201
|
|
|
21159
|
-
for (header in userHeaders) {
|
|
21160
|
-
if (userHeaders
|
|
21202
|
+
for (header in userHeaders) { // eslint-disable-line no-restricted-syntax
|
|
21203
|
+
if (hasOwn(userHeaders, header)) {
|
|
21161
21204
|
formHeaders[header.toLowerCase()] = userHeaders[header];
|
|
21162
21205
|
}
|
|
21163
21206
|
}
|
|
@@ -21165,11 +21208,14 @@ FormData.prototype.getHeaders = function(userHeaders) {
|
|
|
21165
21208
|
return formHeaders;
|
|
21166
21209
|
};
|
|
21167
21210
|
|
|
21168
|
-
FormData.prototype.setBoundary = function(boundary) {
|
|
21211
|
+
FormData.prototype.setBoundary = function (boundary) {
|
|
21212
|
+
if (typeof boundary !== 'string') {
|
|
21213
|
+
throw new TypeError('FormData boundary must be a string');
|
|
21214
|
+
}
|
|
21169
21215
|
this._boundary = boundary;
|
|
21170
21216
|
};
|
|
21171
21217
|
|
|
21172
|
-
FormData.prototype.getBoundary = function() {
|
|
21218
|
+
FormData.prototype.getBoundary = function () {
|
|
21173
21219
|
if (!this._boundary) {
|
|
21174
21220
|
this._generateBoundary();
|
|
21175
21221
|
}
|
|
@@ -21177,60 +21223,55 @@ FormData.prototype.getBoundary = function() {
|
|
|
21177
21223
|
return this._boundary;
|
|
21178
21224
|
};
|
|
21179
21225
|
|
|
21180
|
-
FormData.prototype.getBuffer = function() {
|
|
21181
|
-
var dataBuffer = new Buffer.alloc(
|
|
21226
|
+
FormData.prototype.getBuffer = function () {
|
|
21227
|
+
var dataBuffer = new Buffer.alloc(0); // eslint-disable-line new-cap
|
|
21182
21228
|
var boundary = this.getBoundary();
|
|
21183
21229
|
|
|
21184
21230
|
// Create the form content. Add Line breaks to the end of data.
|
|
21185
21231
|
for (var i = 0, len = this._streams.length; i < len; i++) {
|
|
21186
21232
|
if (typeof this._streams[i] !== 'function') {
|
|
21187
|
-
|
|
21188
21233
|
// Add content to the buffer.
|
|
21189
|
-
if(Buffer.isBuffer(this._streams[i])) {
|
|
21190
|
-
dataBuffer = Buffer.concat(
|
|
21191
|
-
}else {
|
|
21192
|
-
dataBuffer = Buffer.concat(
|
|
21234
|
+
if (Buffer.isBuffer(this._streams[i])) {
|
|
21235
|
+
dataBuffer = Buffer.concat([dataBuffer, this._streams[i]]);
|
|
21236
|
+
} else {
|
|
21237
|
+
dataBuffer = Buffer.concat([dataBuffer, Buffer.from(this._streams[i])]);
|
|
21193
21238
|
}
|
|
21194
21239
|
|
|
21195
21240
|
// Add break after content.
|
|
21196
|
-
if (typeof this._streams[i] !== 'string' || this._streams[i].substring(
|
|
21197
|
-
dataBuffer = Buffer.concat(
|
|
21241
|
+
if (typeof this._streams[i] !== 'string' || this._streams[i].substring(2, boundary.length + 2) !== boundary) {
|
|
21242
|
+
dataBuffer = Buffer.concat([dataBuffer, Buffer.from(FormData.LINE_BREAK)]);
|
|
21198
21243
|
}
|
|
21199
21244
|
}
|
|
21200
21245
|
}
|
|
21201
21246
|
|
|
21202
21247
|
// Add the footer and return the Buffer object.
|
|
21203
|
-
return Buffer.concat(
|
|
21248
|
+
return Buffer.concat([dataBuffer, Buffer.from(this._lastBoundary())]);
|
|
21204
21249
|
};
|
|
21205
21250
|
|
|
21206
|
-
FormData.prototype._generateBoundary = function() {
|
|
21251
|
+
FormData.prototype._generateBoundary = function () {
|
|
21207
21252
|
// This generates a 50 character boundary similar to those used by Firefox.
|
|
21208
|
-
// They are optimized for boyer-moore parsing.
|
|
21209
|
-
var boundary = '--------------------------';
|
|
21210
|
-
for (var i = 0; i < 24; i++) {
|
|
21211
|
-
boundary += Math.floor(Math.random() * 10).toString(16);
|
|
21212
|
-
}
|
|
21213
21253
|
|
|
21214
|
-
|
|
21254
|
+
// They are optimized for boyer-moore parsing.
|
|
21255
|
+
this._boundary = '--------------------------' + crypto.randomBytes(12).toString('hex');
|
|
21215
21256
|
};
|
|
21216
21257
|
|
|
21217
21258
|
// Note: getLengthSync DOESN'T calculate streams length
|
|
21218
|
-
// As workaround one can calculate file size manually
|
|
21219
|
-
|
|
21220
|
-
FormData.prototype.getLengthSync = function() {
|
|
21259
|
+
// As workaround one can calculate file size manually and add it as knownLength option
|
|
21260
|
+
FormData.prototype.getLengthSync = function () {
|
|
21221
21261
|
var knownLength = this._overheadLength + this._valueLength;
|
|
21222
21262
|
|
|
21223
|
-
// Don't get confused, there are 3 "internal" streams for each keyval pair
|
|
21224
|
-
// so it basically checks if there is any value added to the form
|
|
21263
|
+
// 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
|
|
21225
21264
|
if (this._streams.length) {
|
|
21226
21265
|
knownLength += this._lastBoundary().length;
|
|
21227
21266
|
}
|
|
21228
21267
|
|
|
21229
21268
|
// https://github.com/form-data/form-data/issues/40
|
|
21230
21269
|
if (!this.hasKnownLength()) {
|
|
21231
|
-
|
|
21232
|
-
|
|
21233
|
-
|
|
21270
|
+
/*
|
|
21271
|
+
* Some async length retrievers are present
|
|
21272
|
+
* therefore synchronous length calculation is false.
|
|
21273
|
+
* Please use getLength(callback) to get proper length
|
|
21274
|
+
*/
|
|
21234
21275
|
this._error(new Error('Cannot calculate proper length in synchronous way.'));
|
|
21235
21276
|
}
|
|
21236
21277
|
|
|
@@ -21240,7 +21281,7 @@ FormData.prototype.getLengthSync = function() {
|
|
|
21240
21281
|
// Public API to check if length of added values is known
|
|
21241
21282
|
// https://github.com/form-data/form-data/issues/196
|
|
21242
21283
|
// https://github.com/form-data/form-data/issues/262
|
|
21243
|
-
FormData.prototype.hasKnownLength = function() {
|
|
21284
|
+
FormData.prototype.hasKnownLength = function () {
|
|
21244
21285
|
var hasKnownLength = true;
|
|
21245
21286
|
|
|
21246
21287
|
if (this._valuesToMeasure.length) {
|
|
@@ -21250,7 +21291,7 @@ FormData.prototype.hasKnownLength = function() {
|
|
|
21250
21291
|
return hasKnownLength;
|
|
21251
21292
|
};
|
|
21252
21293
|
|
|
21253
|
-
FormData.prototype.getLength = function(cb) {
|
|
21294
|
+
FormData.prototype.getLength = function (cb) {
|
|
21254
21295
|
var knownLength = this._overheadLength + this._valueLength;
|
|
21255
21296
|
|
|
21256
21297
|
if (this._streams.length) {
|
|
@@ -21262,13 +21303,13 @@ FormData.prototype.getLength = function(cb) {
|
|
|
21262
21303
|
return;
|
|
21263
21304
|
}
|
|
21264
21305
|
|
|
21265
|
-
asynckit.parallel(this._valuesToMeasure, this._lengthRetriever, function(err, values) {
|
|
21306
|
+
asynckit.parallel(this._valuesToMeasure, this._lengthRetriever, function (err, values) {
|
|
21266
21307
|
if (err) {
|
|
21267
21308
|
cb(err);
|
|
21268
21309
|
return;
|
|
21269
21310
|
}
|
|
21270
21311
|
|
|
21271
|
-
values.forEach(function(length) {
|
|
21312
|
+
values.forEach(function (length) {
|
|
21272
21313
|
knownLength += length;
|
|
21273
21314
|
});
|
|
21274
21315
|
|
|
@@ -21276,31 +21317,26 @@ FormData.prototype.getLength = function(cb) {
|
|
|
21276
21317
|
});
|
|
21277
21318
|
};
|
|
21278
21319
|
|
|
21279
|
-
FormData.prototype.submit = function(params, cb) {
|
|
21280
|
-
var request
|
|
21281
|
-
|
|
21282
|
-
|
|
21283
|
-
;
|
|
21284
|
-
|
|
21285
|
-
// parse provided url if it's string
|
|
21286
|
-
// or treat it as options object
|
|
21287
|
-
if (typeof params == 'string') {
|
|
21320
|
+
FormData.prototype.submit = function (params, cb) {
|
|
21321
|
+
var request;
|
|
21322
|
+
var options;
|
|
21323
|
+
var defaults = { method: 'post' };
|
|
21288
21324
|
|
|
21289
|
-
|
|
21325
|
+
// parse provided url if it's string or treat it as options object
|
|
21326
|
+
if (typeof params === 'string') {
|
|
21327
|
+
params = parseUrl(params); // eslint-disable-line no-param-reassign
|
|
21328
|
+
/* eslint sort-keys: 0 */
|
|
21290
21329
|
options = populate({
|
|
21291
21330
|
port: params.port,
|
|
21292
21331
|
path: params.pathname,
|
|
21293
21332
|
host: params.hostname,
|
|
21294
21333
|
protocol: params.protocol
|
|
21295
21334
|
}, defaults);
|
|
21296
|
-
|
|
21297
|
-
// use custom params
|
|
21298
|
-
} else {
|
|
21299
|
-
|
|
21335
|
+
} else { // use custom params
|
|
21300
21336
|
options = populate(params, defaults);
|
|
21301
21337
|
// if no port provided use default one
|
|
21302
21338
|
if (!options.port) {
|
|
21303
|
-
options.port = options.protocol
|
|
21339
|
+
options.port = options.protocol === 'https:' ? 443 : 80;
|
|
21304
21340
|
}
|
|
21305
21341
|
}
|
|
21306
21342
|
|
|
@@ -21308,14 +21344,14 @@ FormData.prototype.submit = function(params, cb) {
|
|
|
21308
21344
|
options.headers = this.getHeaders(params.headers);
|
|
21309
21345
|
|
|
21310
21346
|
// https if specified, fallback to http in any other case
|
|
21311
|
-
if (options.protocol
|
|
21347
|
+
if (options.protocol === 'https:') {
|
|
21312
21348
|
request = https.request(options);
|
|
21313
21349
|
} else {
|
|
21314
21350
|
request = http.request(options);
|
|
21315
21351
|
}
|
|
21316
21352
|
|
|
21317
21353
|
// get content length and fire away
|
|
21318
|
-
this.getLength(function(err, length) {
|
|
21354
|
+
this.getLength(function (err, length) {
|
|
21319
21355
|
if (err && err !== 'Unknown stream') {
|
|
21320
21356
|
this._error(err);
|
|
21321
21357
|
return;
|
|
@@ -21334,7 +21370,7 @@ FormData.prototype.submit = function(params, cb) {
|
|
|
21334
21370
|
request.removeListener('error', callback);
|
|
21335
21371
|
request.removeListener('response', onResponse);
|
|
21336
21372
|
|
|
21337
|
-
return cb.call(this, error, responce);
|
|
21373
|
+
return cb.call(this, error, responce); // eslint-disable-line no-invalid-this
|
|
21338
21374
|
};
|
|
21339
21375
|
|
|
21340
21376
|
onResponse = callback.bind(this, null);
|
|
@@ -21347,7 +21383,7 @@ FormData.prototype.submit = function(params, cb) {
|
|
|
21347
21383
|
return request;
|
|
21348
21384
|
};
|
|
21349
21385
|
|
|
21350
|
-
FormData.prototype._error = function(err) {
|
|
21386
|
+
FormData.prototype._error = function (err) {
|
|
21351
21387
|
if (!this.error) {
|
|
21352
21388
|
this.error = err;
|
|
21353
21389
|
this.pause();
|
|
@@ -21358,6 +21394,10 @@ FormData.prototype._error = function(err) {
|
|
|
21358
21394
|
FormData.prototype.toString = function () {
|
|
21359
21395
|
return '[object FormData]';
|
|
21360
21396
|
};
|
|
21397
|
+
setToStringTag(FormData, 'FormData');
|
|
21398
|
+
|
|
21399
|
+
// Public API
|
|
21400
|
+
module.exports = FormData;
|
|
21361
21401
|
|
|
21362
21402
|
|
|
21363
21403
|
/***/ }),
|
|
@@ -21368,12 +21408,13 @@ FormData.prototype.toString = function () {
|
|
|
21368
21408
|
\*************************************************/
|
|
21369
21409
|
/***/ ((module) => {
|
|
21370
21410
|
|
|
21371
|
-
|
|
21372
|
-
module.exports = function(dst, src) {
|
|
21411
|
+
"use strict";
|
|
21373
21412
|
|
|
21374
|
-
|
|
21375
|
-
|
|
21376
|
-
|
|
21413
|
+
|
|
21414
|
+
// populates missing values
|
|
21415
|
+
module.exports = function (dst, src) {
|
|
21416
|
+
Object.keys(src).forEach(function (prop) {
|
|
21417
|
+
dst[prop] = dst[prop] || src[prop]; // eslint-disable-line no-param-reassign
|
|
21377
21418
|
});
|
|
21378
21419
|
|
|
21379
21420
|
return dst;
|
|
@@ -22090,6 +22131,25 @@ module.exports = function hasSymbols() {
|
|
|
22090
22131
|
};
|
|
22091
22132
|
|
|
22092
22133
|
|
|
22134
|
+
/***/ }),
|
|
22135
|
+
|
|
22136
|
+
/***/ "../node_modules/has-tostringtag/shams.js":
|
|
22137
|
+
/*!************************************************!*\
|
|
22138
|
+
!*** ../node_modules/has-tostringtag/shams.js ***!
|
|
22139
|
+
\************************************************/
|
|
22140
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
22141
|
+
|
|
22142
|
+
"use strict";
|
|
22143
|
+
|
|
22144
|
+
|
|
22145
|
+
var hasSymbols = __webpack_require__(/*! has-symbols/shams */ "../node_modules/has-symbols/shams.js");
|
|
22146
|
+
|
|
22147
|
+
/** @type {import('.')} */
|
|
22148
|
+
module.exports = function hasToStringTagShams() {
|
|
22149
|
+
return hasSymbols() && !!Symbol.toStringTag;
|
|
22150
|
+
};
|
|
22151
|
+
|
|
22152
|
+
|
|
22093
22153
|
/***/ }),
|
|
22094
22154
|
|
|
22095
22155
|
/***/ "../node_modules/hasown/index.js":
|
|
@@ -27085,8 +27145,8 @@ class Axios {
|
|
|
27085
27145
|
|
|
27086
27146
|
if (!synchronousRequestInterceptors) {
|
|
27087
27147
|
const chain = [_dispatchRequest_js__WEBPACK_IMPORTED_MODULE_5__["default"].bind(this), undefined];
|
|
27088
|
-
chain.unshift
|
|
27089
|
-
chain.push
|
|
27148
|
+
chain.unshift(...requestInterceptorChain);
|
|
27149
|
+
chain.push(...responseInterceptorChain);
|
|
27090
27150
|
len = chain.length;
|
|
27091
27151
|
|
|
27092
27152
|
promise = Promise.resolve(config);
|
|
@@ -27965,7 +28025,7 @@ function mergeConfig(config1, config2) {
|
|
|
27965
28025
|
headers: (a, b , prop) => mergeDeepProperties(headersToObject(a), headersToObject(b),prop, true)
|
|
27966
28026
|
};
|
|
27967
28027
|
|
|
27968
|
-
_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].forEach(Object.keys(
|
|
28028
|
+
_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].forEach(Object.keys({...config1, ...config2}), function computeConfigValue(prop) {
|
|
27969
28029
|
const merge = mergeMap[prop] || mergeDeepProperties;
|
|
27970
28030
|
const configValue = merge(config1[prop], config2[prop], prop);
|
|
27971
28031
|
(_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
|
|
@@ -28282,7 +28342,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
28282
28342
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
28283
28343
|
/* harmony export */ VERSION: () => (/* binding */ VERSION)
|
|
28284
28344
|
/* harmony export */ });
|
|
28285
|
-
const VERSION = "1.
|
|
28345
|
+
const VERSION = "1.11.0";
|
|
28286
28346
|
|
|
28287
28347
|
/***/ }),
|
|
28288
28348
|
|
|
@@ -29758,7 +29818,7 @@ function throttle(fn, freq) {
|
|
|
29758
29818
|
clearTimeout(timer);
|
|
29759
29819
|
timer = null;
|
|
29760
29820
|
}
|
|
29761
|
-
fn
|
|
29821
|
+
fn(...args);
|
|
29762
29822
|
}
|
|
29763
29823
|
|
|
29764
29824
|
const throttled = (...args) => {
|
|
@@ -30049,7 +30109,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
30049
30109
|
|
|
30050
30110
|
|
|
30051
30111
|
function toURLEncodedForm(data, options) {
|
|
30052
|
-
return (0,_toFormData_js__WEBPACK_IMPORTED_MODULE_0__["default"])(data, new _platform_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].classes.URLSearchParams(),
|
|
30112
|
+
return (0,_toFormData_js__WEBPACK_IMPORTED_MODULE_0__["default"])(data, new _platform_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].classes.URLSearchParams(), {
|
|
30053
30113
|
visitor: function(value, key, path, helpers) {
|
|
30054
30114
|
if (_platform_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].isNode && _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].isBuffer(value)) {
|
|
30055
30115
|
this.append(key, value.toString('base64'));
|
|
@@ -30057,8 +30117,9 @@ function toURLEncodedForm(data, options) {
|
|
|
30057
30117
|
}
|
|
30058
30118
|
|
|
30059
30119
|
return helpers.defaultVisitor.apply(this, arguments);
|
|
30060
|
-
}
|
|
30061
|
-
|
|
30120
|
+
},
|
|
30121
|
+
...options
|
|
30122
|
+
});
|
|
30062
30123
|
}
|
|
30063
30124
|
|
|
30064
30125
|
|
|
@@ -30617,6 +30678,27 @@ const isPlainObject = (val) => {
|
|
|
30617
30678
|
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val);
|
|
30618
30679
|
}
|
|
30619
30680
|
|
|
30681
|
+
/**
|
|
30682
|
+
* Determine if a value is an empty object (safely handles Buffers)
|
|
30683
|
+
*
|
|
30684
|
+
* @param {*} val The value to test
|
|
30685
|
+
*
|
|
30686
|
+
* @returns {boolean} True if value is an empty object, otherwise false
|
|
30687
|
+
*/
|
|
30688
|
+
const isEmptyObject = (val) => {
|
|
30689
|
+
// Early return for non-objects or Buffers to prevent RangeError
|
|
30690
|
+
if (!isObject(val) || isBuffer(val)) {
|
|
30691
|
+
return false;
|
|
30692
|
+
}
|
|
30693
|
+
|
|
30694
|
+
try {
|
|
30695
|
+
return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;
|
|
30696
|
+
} catch (e) {
|
|
30697
|
+
// Fallback for any other objects that might cause RangeError with Object.keys()
|
|
30698
|
+
return false;
|
|
30699
|
+
}
|
|
30700
|
+
}
|
|
30701
|
+
|
|
30620
30702
|
/**
|
|
30621
30703
|
* Determine if a value is a Date
|
|
30622
30704
|
*
|
|
@@ -30739,6 +30821,11 @@ function forEach(obj, fn, {allOwnKeys = false} = {}) {
|
|
|
30739
30821
|
fn.call(null, obj[i], i, obj);
|
|
30740
30822
|
}
|
|
30741
30823
|
} else {
|
|
30824
|
+
// Buffer check
|
|
30825
|
+
if (isBuffer(obj)) {
|
|
30826
|
+
return;
|
|
30827
|
+
}
|
|
30828
|
+
|
|
30742
30829
|
// Iterate over object keys
|
|
30743
30830
|
const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
|
|
30744
30831
|
const len = keys.length;
|
|
@@ -30752,6 +30839,10 @@ function forEach(obj, fn, {allOwnKeys = false} = {}) {
|
|
|
30752
30839
|
}
|
|
30753
30840
|
|
|
30754
30841
|
function findKey(obj, key) {
|
|
30842
|
+
if (isBuffer(obj)){
|
|
30843
|
+
return null;
|
|
30844
|
+
}
|
|
30845
|
+
|
|
30755
30846
|
key = key.toLowerCase();
|
|
30756
30847
|
const keys = Object.keys(obj);
|
|
30757
30848
|
let i = keys.length;
|
|
@@ -31105,6 +31196,11 @@ const toJSONObject = (obj) => {
|
|
|
31105
31196
|
return;
|
|
31106
31197
|
}
|
|
31107
31198
|
|
|
31199
|
+
//Buffer check
|
|
31200
|
+
if (isBuffer(source)) {
|
|
31201
|
+
return source;
|
|
31202
|
+
}
|
|
31203
|
+
|
|
31108
31204
|
if(!('toJSON' in source)) {
|
|
31109
31205
|
stack[i] = source;
|
|
31110
31206
|
const target = isArray(source) ? [] : {};
|
|
@@ -31176,6 +31272,7 @@ const isIterable = (thing) => thing != null && isFunction(thing[iterator]);
|
|
|
31176
31272
|
isBoolean,
|
|
31177
31273
|
isObject,
|
|
31178
31274
|
isPlainObject,
|
|
31275
|
+
isEmptyObject,
|
|
31179
31276
|
isReadableStream,
|
|
31180
31277
|
isRequest,
|
|
31181
31278
|
isResponse,
|
|
@@ -32687,7 +32784,7 @@ function createClient(params, opts = {}) {
|
|
|
32687
32784
|
const sdkMain = opts.type === 'plain' ? 'contentful-management-plain.js' : 'contentful-management.js';
|
|
32688
32785
|
const userAgent = (0,contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__.getUserAgentHeader)(
|
|
32689
32786
|
// @ts-expect-error
|
|
32690
|
-
`${sdkMain}/${"11.55.0-canary.
|
|
32787
|
+
`${sdkMain}/${"11.55.0-canary.2"}`, params.application, params.integration, params.feature);
|
|
32691
32788
|
const adapter = (0,_create_adapter__WEBPACK_IMPORTED_MODULE_1__.createAdapter)(_objectSpread(_objectSpread({}, params), {}, {
|
|
32692
32789
|
userAgent
|
|
32693
32790
|
}));
|