MM-62426: Remove form-data from @mattermost/client (#29792)

Этот коммит содержится в:
Saturnino Abril
2025-01-10 13:28:32 +08:00
коммит произвёл GitHub
родитель 0c213eae9e
Коммит 95b22f47a0
26 изменённых файлов: 322 добавлений и 14 удалений

Просмотреть файл

@@ -13,6 +13,7 @@ exports[`component/PDFPreview should match snapshot, not successful 1`] = `
fileInfo={
Object {
"archived": false,
"channel_id": "channel_id",
"clientId": "client_id",
"create_at": 1,
"delete_at": 1,

Просмотреть файл

@@ -19,6 +19,7 @@ exports[`AudioVideoPreview should match snapshot, cannot play 1`] = `
fileInfo={
Object {
"archived": false,
"channel_id": "channel_id",
"clientId": "client_id",
"create_at": 1,
"delete_at": 1,

Просмотреть файл

@@ -18,6 +18,7 @@ exports[`FileAttachment should match snapshot, after change from file to image 1
fileInfo={
Object {
"archived": false,
"channel_id": "channel_id",
"clientId": "",
"create_at": 0,
"delete_at": 0,
@@ -67,6 +68,7 @@ exports[`FileAttachment should match snapshot, after change from file to image 1
fileInfo={
Object {
"archived": false,
"channel_id": "channel_id",
"clientId": "",
"create_at": 0,
"delete_at": 0,
@@ -112,6 +114,7 @@ exports[`FileAttachment should match snapshot, regular file 1`] = `
fileInfo={
Object {
"archived": false,
"channel_id": "channel_id",
"clientId": "",
"create_at": 0,
"delete_at": 0,
@@ -161,6 +164,7 @@ exports[`FileAttachment should match snapshot, regular file 1`] = `
fileInfo={
Object {
"archived": false,
"channel_id": "channel_id",
"clientId": "",
"create_at": 0,
"delete_at": 0,
@@ -238,6 +242,7 @@ exports[`FileAttachment should match snapshot, regular image 1`] = `
fileInfo={
Object {
"archived": false,
"channel_id": "channel_id",
"clientId": "",
"create_at": 0,
"delete_at": 0,
@@ -315,6 +320,7 @@ exports[`FileAttachment should match snapshot, small image 1`] = `
fileInfo={
Object {
"archived": false,
"channel_id": "channel_id",
"clientId": "",
"create_at": 0,
"delete_at": 0,
@@ -360,6 +366,7 @@ exports[`FileAttachment should match snapshot, svg image 1`] = `
fileInfo={
Object {
"archived": false,
"channel_id": "channel_id",
"clientId": "",
"create_at": 0,
"delete_at": 0,
@@ -409,6 +416,7 @@ exports[`FileAttachment should match snapshot, svg image 1`] = `
fileInfo={
Object {
"archived": false,
"channel_id": "channel_id",
"clientId": "",
"create_at": 0,
"delete_at": 0,
@@ -486,6 +494,7 @@ exports[`FileAttachment should match snapshot, when file is not loaded 1`] = `
fileInfo={
Object {
"archived": false,
"channel_id": "channel_id",
"clientId": "",
"create_at": 0,
"delete_at": 0,
@@ -530,6 +539,7 @@ exports[`FileAttachment should match snapshot, with compact display 1`] = `
fileInfo={
Object {
"archived": false,
"channel_id": "channel_id",
"clientId": "",
"create_at": 0,
"delete_at": 0,
@@ -575,6 +585,7 @@ exports[`FileAttachment should match snapshot, without compact display and witho
fileInfo={
Object {
"archived": false,
"channel_id": "channel_id",
"clientId": "",
"create_at": 0,
"delete_at": 0,

Просмотреть файл

@@ -41,6 +41,7 @@ describe('FileAttachment', () => {
height: 80,
has_preview_image: true,
user_id: '',
channel_id: 'channel_id',
create_at: 0,
update_at: 0,
delete_at: 0,

Просмотреть файл

@@ -17,6 +17,7 @@ describe('components/file_attachment/FilenameOverlay', () => {
height: 80,
has_preview_image: true,
user_id: '',
channel_id: 'channel_id',
create_at: 0,
update_at: 0,
delete_at: 0,

Просмотреть файл

@@ -36,6 +36,7 @@ exports[`FilePreview should match snapshot 1`] = `
fileInfo={
Object {
"archived": false,
"channel_id": "channel_id",
"clientId": "",
"create_at": 0,
"delete_at": 0,
@@ -82,6 +83,7 @@ exports[`FilePreview should match snapshot 1`] = `
fileInfo={
Object {
"archived": false,
"channel_id": "channel_id",
"clientId": "",
"create_at": 0,
"delete_at": 0,
@@ -140,6 +142,7 @@ exports[`FilePreview should match snapshot when props are changed 1`] = `
fileInfo={
Object {
"archived": false,
"channel_id": "channel_id",
"clientId": "",
"create_at": 0,
"delete_at": 0,
@@ -186,6 +189,7 @@ exports[`FilePreview should match snapshot when props are changed 1`] = `
fileInfo={
Object {
"archived": false,
"channel_id": "channel_id",
"clientId": "",
"create_at": 0,
"delete_at": 0,
@@ -244,6 +248,7 @@ exports[`FilePreview should match snapshot when props are changed 2`] = `
fileInfo={
Object {
"archived": false,
"channel_id": "channel_id",
"clientId": "",
"create_at": 0,
"delete_at": 0,

Просмотреть файл

@@ -28,6 +28,7 @@ exports[`component/file_preview/file_progress_preview should match snapshot 1`]
fileInfo={
Object {
"archived": false,
"channel_id": "channel_id",
"clientId": "",
"create_at": 0,
"delete_at": 0,
@@ -112,6 +113,7 @@ exports[`component/file_preview/file_progress_preview snapshot for percent value
fileInfo={
Object {
"archived": false,
"channel_id": "channel_id",
"clientId": "",
"create_at": 0,
"delete_at": 0,

Просмотреть файл

@@ -20,6 +20,7 @@ describe('FilePreview', () => {
extension: 'png',
has_preview_image: true,
user_id: '',
channel_id: 'channel_id',
create_at: 0,
update_at: 0,
delete_at: 0,
@@ -41,6 +42,7 @@ describe('FilePreview', () => {
id: 'file_id_1',
has_preview_image: true,
user_id: '',
channel_id: 'channel_id',
create_at: 0,
update_at: 0,
delete_at: 0,

Просмотреть файл

@@ -19,6 +19,7 @@ describe('component/file_preview/file_progress_preview', () => {
height: 80,
has_preview_image: true,
user_id: '',
channel_id: 'channel_id',
create_at: 0,
update_at: 0,
delete_at: 0,

Просмотреть файл

@@ -66,6 +66,7 @@ exports[`components/FilePreviewModal should fall back to default preview if plug
fileInfo={
Object {
"archived": false,
"channel_id": "channel_id",
"clientId": "client_id",
"create_at": 1,
"delete_at": 1,
@@ -206,6 +207,7 @@ exports[`components/FilePreviewModal should match snapshot 1`] = `
fileInfo={
Object {
"archived": false,
"channel_id": "channel_id",
"clientId": "client_id",
"create_at": 1,
"delete_at": 1,
@@ -346,6 +348,7 @@ exports[`components/FilePreviewModal should match snapshot for external file 1`]
fileInfo={
Object {
"archived": false,
"channel_id": "channel_id",
"clientId": "client_id",
"create_at": 1,
"delete_at": 1,
@@ -486,6 +489,7 @@ exports[`components/FilePreviewModal should match snapshot when plugin overrides
fileInfo={
Object {
"archived": false,
"channel_id": "channel_id",
"clientId": "client_id",
"create_at": 1,
"delete_at": 1,
@@ -547,6 +551,7 @@ exports[`components/FilePreviewModal should match snapshot when plugin overrides
fileInfo={
Object {
"archived": false,
"channel_id": "channel_id",
"clientId": "client_id",
"create_at": 1,
"delete_at": 1,
@@ -664,6 +669,7 @@ exports[`components/FilePreviewModal should match snapshot, loaded 1`] = `
fileInfo={
Object {
"archived": false,
"channel_id": "channel_id",
"clientId": "client_id",
"create_at": 1,
"delete_at": 1,
@@ -726,6 +732,7 @@ exports[`components/FilePreviewModal should match snapshot, loaded 1`] = `
fileInfo={
Object {
"archived": false,
"channel_id": "channel_id",
"clientId": "client_id",
"create_at": 1,
"delete_at": 1,
@@ -815,6 +822,7 @@ exports[`components/FilePreviewModal should match snapshot, loaded and showing f
fileInfo={
Object {
"archived": false,
"channel_id": "channel_id",
"clientId": "client_id",
"create_at": 1,
"delete_at": 1,
@@ -877,6 +885,7 @@ exports[`components/FilePreviewModal should match snapshot, loaded and showing f
fileInfo={
Object {
"archived": false,
"channel_id": "channel_id",
"clientId": "client_id",
"create_at": 1,
"delete_at": 1,
@@ -966,6 +975,7 @@ exports[`components/FilePreviewModal should match snapshot, loaded with .js file
fileInfo={
Object {
"archived": false,
"channel_id": "channel_id",
"clientId": "client_id",
"create_at": 1,
"delete_at": 1,
@@ -1028,6 +1038,7 @@ exports[`components/FilePreviewModal should match snapshot, loaded with .js file
fileInfo={
Object {
"archived": false,
"channel_id": "channel_id",
"clientId": "client_id",
"create_at": 1,
"delete_at": 1,
@@ -1119,6 +1130,7 @@ exports[`components/FilePreviewModal should match snapshot, loaded with .m4a fil
fileInfo={
Object {
"archived": false,
"channel_id": "channel_id",
"clientId": "client_id",
"create_at": 1,
"delete_at": 1,
@@ -1180,6 +1192,7 @@ exports[`components/FilePreviewModal should match snapshot, loaded with .m4a fil
fileInfo={
Object {
"archived": false,
"channel_id": "channel_id",
"clientId": "client_id",
"create_at": 1,
"delete_at": 1,
@@ -1270,6 +1283,7 @@ exports[`components/FilePreviewModal should match snapshot, loaded with .mov fil
fileInfo={
Object {
"archived": false,
"channel_id": "channel_id",
"clientId": "client_id",
"create_at": 1,
"delete_at": 1,
@@ -1331,6 +1345,7 @@ exports[`components/FilePreviewModal should match snapshot, loaded with .mov fil
fileInfo={
Object {
"archived": false,
"channel_id": "channel_id",
"clientId": "client_id",
"create_at": 1,
"delete_at": 1,
@@ -1421,6 +1436,7 @@ exports[`components/FilePreviewModal should match snapshot, loaded with footer 1
fileInfo={
Object {
"archived": false,
"channel_id": "channel_id",
"clientId": "client_id",
"create_at": 1,
"delete_at": 1,
@@ -1483,6 +1499,7 @@ exports[`components/FilePreviewModal should match snapshot, loaded with footer 1
fileInfo={
Object {
"archived": false,
"channel_id": "channel_id",
"clientId": "client_id",
"create_at": 1,
"delete_at": 1,
@@ -1572,6 +1589,7 @@ exports[`components/FilePreviewModal should match snapshot, loaded with image 1`
fileInfo={
Object {
"archived": false,
"channel_id": "channel_id",
"clientId": "client_id",
"create_at": 1,
"delete_at": 1,
@@ -1634,6 +1652,7 @@ exports[`components/FilePreviewModal should match snapshot, loaded with image 1`
fileInfo={
Object {
"archived": false,
"channel_id": "channel_id",
"clientId": "client_id",
"create_at": 1,
"delete_at": 1,
@@ -1723,6 +1742,7 @@ exports[`components/FilePreviewModal should match snapshot, loaded with other fi
fileInfo={
Object {
"archived": false,
"channel_id": "channel_id",
"clientId": "client_id",
"create_at": 1,
"delete_at": 1,
@@ -1784,6 +1804,7 @@ exports[`components/FilePreviewModal should match snapshot, loaded with other fi
fileInfo={
Object {
"archived": false,
"channel_id": "channel_id",
"clientId": "client_id",
"create_at": 1,
"delete_at": 1,

Просмотреть файл

@@ -44,6 +44,7 @@ exports[`components/file_preview_modal/file_preview_modal_footer/FilePreviewModa
fileInfo={
Object {
"archived": false,
"channel_id": "channel_id",
"clientId": "client_id",
"create_at": 1,
"delete_at": 1,
@@ -117,6 +118,7 @@ exports[`components/file_preview_modal/file_preview_modal_footer/FilePreviewModa
fileInfo={
Object {
"archived": false,
"channel_id": "channel_id",
"clientId": "client_id",
"create_at": 1,
"delete_at": 1,

Просмотреть файл

@@ -23,6 +23,7 @@ exports[`components/file_preview_modal/file_preview_modal_header/FilePreviewModa
fileInfo={
Object {
"archived": false,
"channel_id": "channel_id",
"clientId": "client_id",
"create_at": 1,
"delete_at": 1,
@@ -64,6 +65,7 @@ exports[`components/file_preview_modal/file_preview_modal_header/FilePreviewModa
fileInfo={
Object {
"archived": false,
"channel_id": "channel_id",
"clientId": "client_id",
"create_at": 1,
"delete_at": 1,

Просмотреть файл

@@ -13,6 +13,7 @@ exports[`components/file_search_result/FileSearchResultItem should match snapsho
fileInfo={
Object {
"archived": false,
"channel_id": "channel_id",
"clientId": "client_id",
"create_at": 1,
"delete_at": 1,
@@ -110,6 +111,7 @@ exports[`components/file_search_result/FileSearchResultItem should match snapsho
fileInfo={
Object {
"archived": false,
"channel_id": "channel_id",
"clientId": "client_id",
"create_at": 1,
"delete_at": 1,
@@ -216,6 +218,7 @@ exports[`components/file_search_result/FileSearchResultItem should match snapsho
fileInfo={
Object {
"archived": false,
"channel_id": "channel_id",
"clientId": "client_id",
"create_at": 1,
"delete_at": 1,
@@ -322,6 +325,7 @@ exports[`components/file_search_result/FileSearchResultItem should match snapsho
fileInfo={
Object {
"archived": false,
"channel_id": "channel_id",
"clientId": "client_id",
"create_at": 1,
"delete_at": 1,

Просмотреть файл

@@ -45,6 +45,7 @@ exports[`components/SingleImageView permalink preview should render with permali
fileInfo={
Object {
"archived": false,
"channel_id": "channel_id",
"clientId": "client_id",
"create_at": 1,
"delete_at": 1,
@@ -120,6 +121,7 @@ exports[`components/SingleImageView should match snapshot 1`] = `
fileInfo={
Object {
"archived": false,
"channel_id": "channel_id",
"clientId": "client_id",
"create_at": 1,
"delete_at": 1,
@@ -195,6 +197,7 @@ exports[`components/SingleImageView should match snapshot 2`] = `
fileInfo={
Object {
"archived": false,
"channel_id": "channel_id",
"clientId": "client_id",
"create_at": 1,
"delete_at": 1,
@@ -274,6 +277,7 @@ exports[`components/SingleImageView should match snapshot, SVG image 1`] = `
fileInfo={
Object {
"archived": false,
"channel_id": "channel_id",
"clientId": "client_id",
"create_at": 1,
"delete_at": 1,
@@ -353,6 +357,7 @@ exports[`components/SingleImageView should match snapshot, SVG image 2`] = `
fileInfo={
Object {
"archived": false,
"channel_id": "channel_id",
"clientId": "client_id",
"create_at": 1,
"delete_at": 1,
@@ -428,6 +433,7 @@ exports[`components/SingleImageView should set loaded state on callback of onIma
fileInfo={
Object {
"archived": false,
"channel_id": "channel_id",
"clientId": "client_id",
"create_at": 1,
"delete_at": 1,

Просмотреть файл

@@ -575,6 +575,7 @@ class TestHelper {
return {
id: '',
user_id: '',
channel_id: 'channel_id',
create_at: 0,
update_at: 0,
delete_at: 0,
@@ -597,6 +598,7 @@ class TestHelper {
files.push({
id: this.generateId(),
user_id: 'user_id',
channel_id: 'channel_id',
create_at: 1,
update_at: 1,
delete_at: 1,

Просмотреть файл

@@ -360,6 +360,7 @@ export class TestHelper {
const defaultFileInfo: FileInfo = {
id: 'file_info_id',
user_id: 'user_id',
channel_id: 'channel_id',
create_at: 1,
update_at: 1,
delete_at: 1,

11
webapp/package-lock.json сгенерированный
Просмотреть файл

@@ -8770,7 +8770,8 @@
"node_modules/asynckit": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==",
"dev": true
},
"node_modules/at-least-node": {
"version": "1.0.0",
@@ -10516,6 +10517,7 @@
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
"dev": true,
"dependencies": {
"delayed-stream": "~1.0.0"
},
@@ -11767,6 +11769,7 @@
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
"integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==",
"dev": true,
"engines": {
"node": ">=0.4.0"
}
@@ -14079,6 +14082,7 @@
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz",
"integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==",
"dev": true,
"dependencies": {
"asynckit": "^0.4.0",
"combined-stream": "^1.0.8",
@@ -20841,6 +20845,7 @@
"version": "2.1.35",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
"integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
"dev": true,
"dependencies": {
"mime-db": "1.52.0"
},
@@ -20852,6 +20857,7 @@
"version": "1.52.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
"integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
"dev": true,
"engines": {
"node": ">= 0.6"
}
@@ -28176,9 +28182,6 @@
"name": "@mattermost/client",
"version": "9.3.0",
"license": "MIT",
"dependencies": {
"form-data": "^4.0.0"
},
"devDependencies": {
"@types/jest": "28.1.8",
"jest": "27.1.0",

Просмотреть файл

@@ -17,9 +17,6 @@
"url": "github:mattermost/mattermost",
"directory": "webapp/platform/client"
},
"dependencies": {
"form-data": "^4.0.0"
},
"devDependencies": {
"@types/jest": "28.1.8",
"jest": "27.1.0",

Просмотреть файл

@@ -3,7 +3,6 @@
/* eslint-disable max-lines */
import FormData from 'form-data';
import {
TrackPropertyUser,
TrackPropertyUserAgent, TrackScheduledPostsFeature,

Просмотреть файл

@@ -4,6 +4,7 @@
export type FileInfo = {
id: string;
user_id: string;
channel_id: string;
create_at: number;
update_at: number;
delete_at: number;