@uppy/xhr-upload
Advanced tools
Comparing version 3.6.4 to 4.0.0-beta.1
# @uppy/xhr-upload | ||
## 4.0.0-beta.1 | ||
Released: 2024-03-28 | ||
Included in: Uppy v4.0.0-beta.1 | ||
- @uppy/aws-s3-multipart,@uppy/tus,@uppy/utils,@uppy/xhr-upload: Make `allowedMetaFields` consistent (Merlijn Vos / #5011) | ||
## 3.6.4 | ||
@@ -4,0 +11,0 @@ |
@@ -17,6 +17,8 @@ function _classPrivateFieldLooseBase(receiver, privateKey) { if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) { throw new TypeError("attempted to use private field on non-instance"); } return receiver; } | ||
// @ts-ignore We don't want TS to generate types for the package.json | ||
import getAllowedMetaFields from '@uppy/utils/lib/getAllowedMetaFields'; | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-ignore We don't want TS to generate types for the package.json | ||
const packageJson = { | ||
"version": "3.6.4" | ||
"version": "4.0.0-beta.1" | ||
}; | ||
@@ -60,3 +62,3 @@ import locale from "./locale.js"; | ||
method: 'post', | ||
allowedMetaFields: null, | ||
allowedMetaFields: true, | ||
responseUrlFieldName: 'url', | ||
@@ -208,4 +210,3 @@ bundle: false, | ||
addMetadata(formData, meta, opts) { | ||
const allowedMetaFields = Array.isArray(opts.allowedMetaFields) ? opts.allowedMetaFields : Object.keys(meta); // Send along all fields by default. | ||
const allowedMetaFields = getAllowedMetaFields(opts.allowedMetaFields, meta); | ||
allowedMetaFields.forEach(item => { | ||
@@ -489,5 +490,3 @@ const value = meta[item]; | ||
const opts = this.getOptions(file); | ||
const allowedMetaFields = Array.isArray(opts.allowedMetaFields) ? opts.allowedMetaFields | ||
// Send along all fields by default. | ||
: Object.keys(file.meta); | ||
const allowedMetaFields = getAllowedMetaFields(opts.allowedMetaFields, file.meta); | ||
return { | ||
@@ -494,0 +493,0 @@ ...((_file$remote = file.remote) == null ? void 0 : _file$remote.body), |
{ | ||
"name": "@uppy/xhr-upload", | ||
"description": "Plain and simple classic HTML multipart form uploads with Uppy, as well as uploads using the HTTP PUT method.", | ||
"version": "3.6.4", | ||
"version": "4.0.0-beta.1", | ||
"license": "MIT", | ||
"main": "lib/index.js", | ||
"types": "types/index.d.ts", | ||
"type": "module", | ||
@@ -28,4 +27,4 @@ "keywords": [ | ||
"dependencies": { | ||
"@uppy/companion-client": "^3.7.4", | ||
"@uppy/utils": "^5.7.4", | ||
"@uppy/companion-client": "^4.0.0-beta.1", | ||
"@uppy/utils": "^6.0.0-beta.1", | ||
"nanoid": "^4.0.0" | ||
@@ -38,4 +37,5 @@ }, | ||
"peerDependencies": { | ||
"@uppy/core": "^3.9.3" | ||
} | ||
"@uppy/core": "^4.0.0-beta.1" | ||
}, | ||
"stableVersion": "3.6.4" | ||
} |
@@ -23,2 +23,3 @@ import BasePlugin from '@uppy/core/lib/BasePlugin.js' | ||
import type { State, Uppy } from '@uppy/core' | ||
import getAllowedMetaFields from '@uppy/utils/lib/getAllowedMetaFields' | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
@@ -65,3 +66,3 @@ // @ts-ignore We don't want TS to generate types for the package.json | ||
getResponseError?: (body: string, xhr: XMLHttpRequest) => Error | NetworkError | ||
allowedMetaFields?: string[] | null | ||
allowedMetaFields?: string[] | boolean | ||
bundle?: boolean | ||
@@ -110,3 +111,3 @@ responseUrlFieldName?: string | ||
method: 'post', | ||
allowedMetaFields: null, | ||
allowedMetaFields: true, | ||
responseUrlFieldName: 'url', | ||
@@ -246,6 +247,3 @@ bundle: false, | ||
): void { | ||
const allowedMetaFields = | ||
Array.isArray(opts.allowedMetaFields) ? | ||
opts.allowedMetaFields | ||
: Object.keys(meta) // Send along all fields by default. | ||
const allowedMetaFields = getAllowedMetaFields(opts.allowedMetaFields, meta) | ||
@@ -567,7 +565,6 @@ allowedMetaFields.forEach((item) => { | ||
const opts = this.getOptions(file) | ||
const allowedMetaFields = | ||
Array.isArray(opts.allowedMetaFields) ? | ||
opts.allowedMetaFields | ||
// Send along all fields by default. | ||
: Object.keys(file.meta) | ||
const allowedMetaFields = getAllowedMetaFields( | ||
opts.allowedMetaFields, | ||
file.meta, | ||
) | ||
return { | ||
@@ -574,0 +571,0 @@ ...file.remote?.body, |
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
102023
15
1306
0
1
+ Added@uppy/companion-client@4.4.1(transitive)
+ Added@uppy/core@4.4.1(transitive)
+ Added@uppy/store-default@4.2.0(transitive)
+ Added@uppy/utils@6.1.1(transitive)
+ Addednanoid@5.0.9(transitive)
- Removed@uppy/companion-client@3.8.2(transitive)
- Removed@uppy/core@3.13.1(transitive)
- Removed@uppy/store-default@3.2.2(transitive)
- Removed@uppy/utils@5.9.0(transitive)
Updated@uppy/utils@^6.0.0-beta.1