From f8c761911f46c37f83a06903efc44313a866efe8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Jun 2025 10:41:55 +0000 Subject: [PATCH 1/2] Bump form-data from 4.0.2 to 4.0.3 Bumps [form-data](https://github.com/form-data/form-data) from 4.0.2 to 4.0.3. - [Release notes](https://github.com/form-data/form-data/releases) - [Commits](https://github.com/form-data/form-data/compare/v4.0.2...v4.0.3) --- updated-dependencies: - dependency-name: form-data dependency-version: 4.0.3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 10 +++++----- package.json | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index b8741a5a..4841d920 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,7 @@ "@octokit/plugin-retry": "^8.0.1", "@octokit/plugin-throttling": "^11.0.1", "ajv": "8.17.1", - "form-data": "^4.0.2", + "form-data": "^4.0.3", "jszip": "3.10.1", "semver": "^7.7.2", "uuid": "^11.1.0", @@ -7188,14 +7188,14 @@ } }, "node_modules/form-data": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.2.tgz", - "integrity": "sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w==", - "license": "MIT", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.3.tgz", + "integrity": "sha512-qsITQPfmvMOSAdeyZ+12I1c+CKSstAFAwu+97zrnWAbIr5u8wfsExUzCesVLC8NgHuRUqNN4Zy6UPWUTRGslcA==", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.2", "mime-types": "^2.1.12" }, "engines": { diff --git a/package.json b/package.json index d36563a9..eb352c1e 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "@octokit/plugin-retry": "^8.0.1", "@octokit/plugin-throttling": "^11.0.1", "ajv": "8.17.1", - "form-data": "^4.0.2", + "form-data": "^4.0.3", "jszip": "3.10.1", "semver": "^7.7.2", "uuid": "^11.1.0", From c9bea906b85ac79a82a3391ffeb5e7034f182b63 Mon Sep 17 00:00:00 2001 From: Robert Date: Wed, 18 Jun 2025 12:24:27 +0100 Subject: [PATCH 2/2] Update js --- dist/query.js | 70 ++++++++++++++++++++++++++++----------------------- 1 file changed, 38 insertions(+), 32 deletions(-) diff --git a/dist/query.js b/dist/query.js index a7e29625..c590bda0 100644 --- a/dist/query.js +++ b/dist/query.js @@ -40857,6 +40857,7 @@ var require_es_set_tostringtag = __commonJS({ // node_modules/form-data/lib/populate.js var require_populate = __commonJS({ "node_modules/form-data/lib/populate.js"(exports2, module2) { + "use strict"; module2.exports = function(dst, src) { Object.keys(src).forEach(function(prop) { dst[prop] = dst[prop] || src[prop]; @@ -40869,6 +40870,7 @@ var require_populate = __commonJS({ // node_modules/form-data/lib/form_data.js var require_form_data = __commonJS({ "node_modules/form-data/lib/form_data.js"(exports2, module2) { + "use strict"; var CombinedStream = require_combined_stream(); var util2 = require("util"); var path4 = require("path"); @@ -40880,9 +40882,8 @@ var require_form_data = __commonJS({ var mime = require_mime_types(); var asynckit = require_asynckit(); var setToStringTag = require_es_set_tostringtag(); + var hasOwn = require_hasown(); var populate = require_populate(); - module2.exports = FormData2; - util2.inherits(FormData2, CombinedStream); function FormData2(options) { if (!(this instanceof FormData2)) { return new FormData2(options); @@ -40896,16 +40897,17 @@ var require_form_data = __commonJS({ this[option] = options[option]; } } + util2.inherits(FormData2, CombinedStream); FormData2.LINE_BREAK = "\r\n"; FormData2.DEFAULT_CONTENT_TYPE = "application/octet-stream"; FormData2.prototype.append = function(field, value, options) { options = options || {}; - if (typeof options == "string") { + if (typeof options === "string") { options = { filename: options }; } var append = CombinedStream.prototype.append.bind(this); - if (typeof value == "number") { - value = "" + value; + if (typeof value === "number" || value == null) { + value = String(value); } if (Array.isArray(value)) { this._error(new Error("Arrays are not supported.")); @@ -40921,7 +40923,7 @@ var require_form_data = __commonJS({ FormData2.prototype._trackLength = function(header, value, options) { var valueLength = 0; if (options.knownLength != null) { - valueLength += +options.knownLength; + valueLength += Number(options.knownLength); } else if (Buffer.isBuffer(value)) { valueLength = value.length; } else if (typeof value === "string") { @@ -40929,7 +40931,7 @@ var require_form_data = __commonJS({ } this._valueLength += valueLength; this._overheadLength += Buffer.byteLength(header) + FormData2.LINE_BREAK.length; - if (!value || !value.path && !(value.readable && Object.prototype.hasOwnProperty.call(value, "httpVersion")) && !(value instanceof Stream)) { + if (!value || !value.path && !(value.readable && hasOwn(value, "httpVersion")) && !(value instanceof Stream)) { return; } if (!options.knownLength) { @@ -40937,26 +40939,25 @@ var require_form_data = __commonJS({ } }; FormData2.prototype._lengthRetriever = function(value, callback) { - if (Object.prototype.hasOwnProperty.call(value, "fd")) { + if (hasOwn(value, "fd")) { if (value.end != void 0 && value.end != Infinity && value.start != void 0) { callback(null, value.end + 1 - (value.start ? value.start : 0)); } else { fs6.stat(value.path, function(err, stat) { - var fileSize; if (err) { callback(err); return; } - fileSize = stat.size - (value.start ? value.start : 0); + var fileSize = stat.size - (value.start ? value.start : 0); callback(null, fileSize); }); } - } else if (Object.prototype.hasOwnProperty.call(value, "httpVersion")) { - callback(null, +value.headers["content-length"]); - } else if (Object.prototype.hasOwnProperty.call(value, "httpModule")) { + } else if (hasOwn(value, "httpVersion")) { + callback(null, Number(value.headers["content-length"])); + } else if (hasOwn(value, "httpModule")) { value.on("response", function(response) { value.pause(); - callback(null, +response.headers["content-length"]); + callback(null, Number(response.headers["content-length"])); }); value.resume(); } else { @@ -40964,7 +40965,7 @@ var require_form_data = __commonJS({ } }; FormData2.prototype._multiPartHeader = function(field, value, options) { - if (typeof options.header == "string") { + if (typeof options.header === "string") { return options.header; } var contentDisposition = this._getContentDisposition(value, options); @@ -40976,12 +40977,12 @@ var require_form_data = __commonJS({ // if no content type. allow it to be empty array "Content-Type": [].concat(contentType || []) }; - if (typeof options.header == "object") { + if (typeof options.header === "object") { populate(headers, options.header); } var header; for (var prop in headers) { - if (Object.prototype.hasOwnProperty.call(headers, prop)) { + if (hasOwn(headers, prop)) { header = headers[prop]; if (header == null) { continue; @@ -40997,34 +40998,33 @@ var require_form_data = __commonJS({ return "--" + this.getBoundary() + FormData2.LINE_BREAK + contents + FormData2.LINE_BREAK; }; FormData2.prototype._getContentDisposition = function(value, options) { - var filename, contentDisposition; + var filename; if (typeof options.filepath === "string") { filename = path4.normalize(options.filepath).replace(/\\/g, "/"); - } else if (options.filename || value.name || value.path) { - filename = path4.basename(options.filename || value.name || value.path); - } else if (value.readable && Object.prototype.hasOwnProperty.call(value, "httpVersion")) { + } else if (options.filename || value && (value.name || value.path)) { + filename = path4.basename(options.filename || value && (value.name || value.path)); + } else if (value && value.readable && hasOwn(value, "httpVersion")) { filename = path4.basename(value.client._httpMessage.path || ""); } if (filename) { - contentDisposition = 'filename="' + filename + '"'; + return 'filename="' + filename + '"'; } - return contentDisposition; }; FormData2.prototype._getContentType = function(value, options) { var contentType = options.contentType; - if (!contentType && value.name) { + if (!contentType && value && value.name) { contentType = mime.lookup(value.name); } - if (!contentType && value.path) { + if (!contentType && value && value.path) { contentType = mime.lookup(value.path); } - if (!contentType && value.readable && Object.prototype.hasOwnProperty.call(value, "httpVersion")) { + if (!contentType && value && value.readable && hasOwn(value, "httpVersion")) { contentType = value.headers["content-type"]; } if (!contentType && (options.filepath || options.filename)) { contentType = mime.lookup(options.filepath || options.filename); } - if (!contentType && typeof value == "object") { + if (!contentType && value && typeof value === "object") { contentType = FormData2.DEFAULT_CONTENT_TYPE; } return contentType; @@ -41048,13 +41048,16 @@ var require_form_data = __commonJS({ "content-type": "multipart/form-data; boundary=" + this.getBoundary() }; for (header in userHeaders) { - if (Object.prototype.hasOwnProperty.call(userHeaders, header)) { + if (hasOwn(userHeaders, header)) { formHeaders[header.toLowerCase()] = userHeaders[header]; } } return formHeaders; }; FormData2.prototype.setBoundary = function(boundary) { + if (typeof boundary !== "string") { + throw new TypeError("FormData boundary must be a string"); + } this._boundary = boundary; }; FormData2.prototype.getBoundary = function() { @@ -41125,8 +41128,10 @@ var require_form_data = __commonJS({ }); }; FormData2.prototype.submit = function(params, cb) { - var request2, options, defaults = { method: "post" }; - if (typeof params == "string") { + var request2; + var options; + var defaults = { method: "post" }; + if (typeof params === "string") { params = parseUrl2(params); options = populate({ port: params.port, @@ -41137,11 +41142,11 @@ var require_form_data = __commonJS({ } else { options = populate(params, defaults); if (!options.port) { - options.port = options.protocol == "https:" ? 443 : 80; + options.port = options.protocol === "https:" ? 443 : 80; } } options.headers = this.getHeaders(params.headers); - if (options.protocol == "https:") { + if (options.protocol === "https:") { request2 = https.request(options); } else { request2 = http.request(options); @@ -41180,6 +41185,7 @@ var require_form_data = __commonJS({ return "[object FormData]"; }; setToStringTag(FormData2, "FormData"); + module2.exports = FormData2; } });