Merge pull request #50970 from nextcloud/dependabot/npm_and_yarn/webdav-5.8.0

This commit is contained in:
dependabot[bot] 2025-03-02 14:59:17 +00:00 committed by GitHub
commit 07174125a8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 181 additions and 78 deletions

View file

@ -14,9 +14,11 @@ import { loadState } from '@nextcloud/initial-state'
import TagMultipleSvg from '@mdi/svg/svg/tag-multiple.svg?raw'
const restrictSystemTagsCreationToAdmin = loadState<'0'|'1'>('settings', 'restrictSystemTagsCreationToAdmin', '0') === '1'
/**
*
* @param nodes
* Spawn a dialog to add or remove tags from multiple nodes.
* @param nodes Nodes to modify tags for
*/
async function execBatch(nodes: Node[]): Promise<(null|boolean)[]> {
const response = await new Promise<null|boolean>((resolve) => {
@ -37,7 +39,7 @@ export const action = new FileAction({
// If the app is disabled, the action is not available anyway
enabled(nodes) {
// By default, everyone can create system tags
if (loadState('settings', 'restrictSystemTagsCreationToAdmin', '0') === '1' && getCurrentUser()?.isAdmin !== true) {
if (restrictSystemTagsCreationToAdmin && getCurrentUser()?.isAdmin !== true) {
return false
}
@ -50,7 +52,7 @@ export const action = new FileAction({
}
// Disabled for non dav resources
if (nodes.some((node) => !node.isDavRessource)) {
if (nodes.some((node) => !node.isDavResource)) {
return false
}

View file

@ -5,9 +5,10 @@
import type { DAVResultResponseProps } from 'webdav'
import type { ServerTag, Tag } from './types.js'
import { describe, expect, it } from 'vitest'
import { formatTag, parseIdFromLocation, parseTags } from './utils'
import { describe, expect, it } from 'vitest'
import { formatTag, getNodeSystemTags, parseIdFromLocation, parseTags } from './utils'
import { Folder } from '@nextcloud/files'
describe('systemtags - utils', () => {
describe('parseTags', () => {
@ -85,4 +86,92 @@ describe('systemtags - utils', () => {
})
})
})
describe('getNodeSystemTags', () => {
it('parses a plain tag', () => {
const node = new Folder({
owner: 'test',
source: 'https://example.com/remote.php/dav/files/test/folder',
attributes: {
'system-tags': {
'system-tag': 'tag',
},
},
})
expect(getNodeSystemTags(node)).toStrictEqual(['tag'])
})
it('parses plain tags', () => {
const node = new Folder({
owner: 'test',
source: 'https://example.com/remote.php/dav/files/test/folder',
attributes: {
'system-tags': {
'system-tag': [
'tag',
'my-tag',
],
},
},
})
expect(getNodeSystemTags(node)).toStrictEqual(['tag', 'my-tag'])
})
it('parses tag with attributes', () => {
const node = new Folder({
owner: 'test',
source: 'https://example.com/remote.php/dav/files/test/folder',
attributes: {
'system-tags': {
'system-tag': {
text: 'tag',
'@can-assign': true,
},
},
},
})
expect(getNodeSystemTags(node)).toStrictEqual(['tag'])
})
it('parses tags with attributes', () => {
const node = new Folder({
owner: 'test',
source: 'https://example.com/remote.php/dav/files/test/folder',
attributes: {
'system-tags': {
'system-tag': [
{
text: 'tag',
'@can-assign': true,
},
{
text: 'my-tag',
'@can-assign': false,
},
],
},
},
})
expect(getNodeSystemTags(node)).toStrictEqual(['tag', 'my-tag'])
})
it('parses tags mixed with and without attributes', () => {
const node = new Folder({
owner: 'test',
source: 'https://example.com/remote.php/dav/files/test/folder',
attributes: {
'system-tags': {
'system-tag': [
'tag',
{
text: 'my-tag',
'@can-assign': false,
},
],
},
},
})
expect(getNodeSystemTags(node)).toStrictEqual(['tag', 'my-tag'])
})
})
})

View file

@ -59,13 +59,22 @@ export const formatTag = (initialTag: Tag | ServerTag): ServerTag => {
}
export const getNodeSystemTags = function(node: Node): string[] {
const tags = node.attributes?.['system-tags']?.['system-tag'] as string|string[]|undefined
if (tags === undefined) {
const attribute = node.attributes?.['system-tags']?.['system-tag']
if (attribute === undefined) {
return []
}
return [tags].flat()
// if there is only one tag it is a single string or prop object
// if there are multiple then its an array - so we flatten it to be always an array of string or prop objects
return [attribute]
.flat()
.map((tag: string|{ text: string }) => (
typeof tag === 'string'
// its a plain text prop (the tag name) without prop attributes
? tag
// its a prop object with attributes, the tag name is in the 'text' attribute
: tag.text
))
}
export const setNodeSystemTags = function(node: Node, tags: string[]): void {

View file

@ -161,7 +161,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.3.0
- license: MIT
- fast-xml-parser
- version: 4.4.1
- version: 4.5.3
- license: MIT
- floating-vue
- version: 1.0.0-beta.19
@ -296,7 +296,7 @@ This file is generated from multiple sources. Included packages:
- version: 1.3.0
- license: MIT
- strnum
- version: 1.0.5
- version: 1.1.2
- license: MIT
- style-loader
- version: 4.0.0
@ -335,7 +335,7 @@ This file is generated from multiple sources. Included packages:
- version: 2.7.16
- license: MIT
- webdav
- version: 5.7.1
- version: 5.8.0
- license: MIT
- which-typed-array
- version: 1.1.15

View file

@ -165,7 +165,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.3.0
- license: MIT
- fast-xml-parser
- version: 4.4.1
- version: 4.5.3
- license: MIT
- floating-vue
- version: 1.0.0-beta.19
@ -306,7 +306,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.2.0
- license: MIT
- strnum
- version: 1.0.5
- version: 1.1.2
- license: MIT
- style-loader
- version: 4.0.0
@ -354,7 +354,7 @@ This file is generated from multiple sources. Included packages:
- version: 2.7.16
- license: MIT
- webdav
- version: 5.7.1
- version: 5.8.0
- license: MIT
- which-typed-array
- version: 1.1.15

View file

@ -165,7 +165,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.3.0
- license: MIT
- fast-xml-parser
- version: 4.4.1
- version: 4.5.3
- license: MIT
- floating-vue
- version: 1.0.0-beta.19
@ -306,7 +306,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.2.0
- license: MIT
- strnum
- version: 1.0.5
- version: 1.1.2
- license: MIT
- style-loader
- version: 4.0.0
@ -354,7 +354,7 @@ This file is generated from multiple sources. Included packages:
- version: 2.7.16
- license: MIT
- webdav
- version: 5.7.1
- version: 5.8.0
- license: MIT
- which-typed-array
- version: 1.1.15

View file

@ -165,7 +165,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.3.0
- license: MIT
- fast-xml-parser
- version: 4.4.1
- version: 4.5.3
- license: MIT
- floating-vue
- version: 1.0.0-beta.19
@ -306,7 +306,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.2.0
- license: MIT
- strnum
- version: 1.0.5
- version: 1.1.2
- license: MIT
- style-loader
- version: 4.0.0
@ -354,7 +354,7 @@ This file is generated from multiple sources. Included packages:
- version: 2.7.16
- license: MIT
- webdav
- version: 5.7.1
- version: 5.8.0
- license: MIT
- which-typed-array
- version: 1.1.15

View file

@ -165,7 +165,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.3.0
- license: MIT
- fast-xml-parser
- version: 4.4.1
- version: 4.5.3
- license: MIT
- floating-vue
- version: 1.0.0-beta.19
@ -306,7 +306,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.2.0
- license: MIT
- strnum
- version: 1.0.5
- version: 1.1.2
- license: MIT
- style-loader
- version: 4.0.0
@ -354,7 +354,7 @@ This file is generated from multiple sources. Included packages:
- version: 2.7.16
- license: MIT
- webdav
- version: 5.7.1
- version: 5.8.0
- license: MIT
- webpack
- version: 5.94.0

View file

@ -135,7 +135,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.3.0
- license: MIT
- fast-xml-parser
- version: 4.4.1
- version: 4.5.3
- license: MIT
- for-each
- version: 0.3.3
@ -267,7 +267,7 @@ This file is generated from multiple sources. Included packages:
- version: 1.3.0
- license: MIT
- strnum
- version: 1.0.5
- version: 1.1.2
- license: MIT
- url-join
- version: 5.0.0
@ -288,7 +288,7 @@ This file is generated from multiple sources. Included packages:
- version: 2.7.16
- license: MIT
- webdav
- version: 5.7.1
- version: 5.8.0
- license: MIT
- webpack
- version: 5.94.0

4
dist/core-common.js vendored

File diff suppressed because one or more lines are too long

View file

@ -299,7 +299,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.0.2
- license: MIT
- fast-xml-parser
- version: 4.4.1
- version: 4.5.3
- license: MIT
- filter-obj
- version: 5.1.0
@ -659,7 +659,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.2.0
- license: MIT
- strnum
- version: 1.0.5
- version: 1.1.2
- license: MIT
- style-loader
- version: 4.0.0
@ -752,7 +752,7 @@ This file is generated from multiple sources. Included packages:
- version: 2.0.1
- license: MIT
- webdav
- version: 5.7.1
- version: 5.8.0
- license: MIT
- which-typed-array
- version: 1.1.15

File diff suppressed because one or more lines are too long

View file

@ -186,7 +186,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.3.0
- license: MIT
- fast-xml-parser
- version: 4.4.1
- version: 4.5.3
- license: MIT
- floating-vue
- version: 1.0.0-beta.19
@ -333,7 +333,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.2.0
- license: MIT
- strnum
- version: 1.0.5
- version: 1.1.2
- license: MIT
- style-loader
- version: 4.0.0
@ -384,7 +384,7 @@ This file is generated from multiple sources. Included packages:
- version: 2.7.16
- license: MIT
- webdav
- version: 5.7.1
- version: 5.8.0
- license: MIT
- webpack
- version: 5.94.0

View file

@ -206,7 +206,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.3.0
- license: MIT
- fast-xml-parser
- version: 4.4.1
- version: 4.5.3
- license: MIT
- floating-vue
- version: 1.0.0-beta.19
@ -347,7 +347,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.2.0
- license: MIT
- strnum
- version: 1.0.5
- version: 1.1.2
- license: MIT
- style-loader
- version: 4.0.0
@ -398,7 +398,7 @@ This file is generated from multiple sources. Included packages:
- version: 2.7.16
- license: MIT
- webdav
- version: 5.7.1
- version: 5.8.0
- license: MIT
- webpack
- version: 5.94.0

File diff suppressed because one or more lines are too long

View file

@ -198,7 +198,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.3.0
- license: MIT
- fast-xml-parser
- version: 4.4.1
- version: 4.5.3
- license: MIT
- floating-vue
- version: 1.0.0-beta.19
@ -348,7 +348,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.2.0
- license: MIT
- strnum
- version: 1.0.5
- version: 1.1.2
- license: MIT
- style-loader
- version: 4.0.0
@ -402,7 +402,7 @@ This file is generated from multiple sources. Included packages:
- version: 2.7.16
- license: MIT
- webdav
- version: 5.7.1
- version: 5.8.0
- license: MIT
- webpack
- version: 5.94.0

View file

@ -208,7 +208,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.0.2
- license: MIT
- fast-xml-parser
- version: 4.4.1
- version: 4.5.3
- license: MIT
- floating-vue
- version: 1.0.0-beta.19
@ -421,7 +421,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.2.0
- license: MIT
- strnum
- version: 1.0.5
- version: 1.1.2
- license: MIT
- style-loader
- version: 4.0.0

View file

@ -181,7 +181,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.3.0
- license: MIT
- fast-xml-parser
- version: 4.4.1
- version: 4.5.3
- license: MIT
- floating-vue
- version: 1.0.0-beta.19
@ -319,7 +319,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.2.0
- license: MIT
- strnum
- version: 1.0.5
- version: 1.1.2
- license: MIT
- style-loader
- version: 4.0.0
@ -364,7 +364,7 @@ This file is generated from multiple sources. Included packages:
- version: 2.7.16
- license: MIT
- webdav
- version: 5.7.1
- version: 5.8.0
- license: MIT
- webpack
- version: 5.94.0

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -183,7 +183,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.3.0
- license: MIT
- fast-xml-parser
- version: 4.4.1
- version: 4.5.3
- license: MIT
- floating-vue
- version: 1.0.0-beta.19
@ -321,7 +321,7 @@ This file is generated from multiple sources. Included packages:
- version: 1.3.0
- license: MIT
- strnum
- version: 1.0.5
- version: 1.1.2
- license: MIT
- style-loader
- version: 4.0.0
@ -354,7 +354,7 @@ This file is generated from multiple sources. Included packages:
- version: 2.7.16
- license: MIT
- webdav
- version: 5.7.1
- version: 5.8.0
- license: MIT
- webpack
- version: 5.94.0

File diff suppressed because one or more lines are too long

45
package-lock.json generated
View file

@ -85,7 +85,7 @@
"vuedraggable": "^2.24.3",
"vuex": "^3.6.2",
"vuex-router-sync": "^5.0.0",
"webdav": "^5.7.0"
"webdav": "^5.8.0"
},
"devDependencies": {
"@babel/node": "^7.26.0",
@ -13198,22 +13198,18 @@
"license": "MIT"
},
"node_modules/fast-xml-parser": {
"version": "4.4.1",
"resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.4.1.tgz",
"integrity": "sha512-xkjOecfnKGkSsOwtZ5Pz7Us/T6mrbPQrq0nh+aCO5V9nk5NLWmasAHumTKjiPJPWANe+kAZ84Jc8ooJkzZ88Sw==",
"version": "4.5.3",
"resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.5.3.tgz",
"integrity": "sha512-RKihhV+SHsIUGXObeVy9AXiBbFwkVk7Syp8XgwN5U3JV416+Gwp/GO9i0JYKmikykgz/UHRrrV4ROuZEo/T0ig==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/NaturalIntelligence"
},
{
"type": "paypal",
"url": "https://paypal.me/naturalintelligence"
}
],
"license": "MIT",
"dependencies": {
"strnum": "^1.0.5"
"strnum": "^1.1.1"
},
"bin": {
"fxparser": "src/cli/cli.js"
@ -23300,9 +23296,15 @@
"license": "MIT"
},
"node_modules/strnum": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/strnum/-/strnum-1.0.5.tgz",
"integrity": "sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==",
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/strnum/-/strnum-1.1.2.tgz",
"integrity": "sha512-vrN+B7DBIoTTZjnPNewwhx6cBA/H+IS7rfW68n7XxC1y7uoiGQBxaKzqucGUgavX15dJgiGztLJ8vxuEzwqBdA==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/NaturalIntelligence"
}
],
"license": "MIT"
},
"node_modules/style-loader": {
@ -26577,15 +26579,16 @@
}
},
"node_modules/webdav": {
"version": "5.7.1",
"resolved": "https://registry.npmjs.org/webdav/-/webdav-5.7.1.tgz",
"integrity": "sha512-JVPn3nLxXJfHSRvennHsOrDYjFLkilZ1Qlw8Ff6hpqp6AvkgF7a//aOh5wA4rMp+sLZ1Km0V+iv0LyO1FIwtXg==",
"version": "5.8.0",
"resolved": "https://registry.npmjs.org/webdav/-/webdav-5.8.0.tgz",
"integrity": "sha512-iuFG7NamJ41Oshg4930iQgfIpRrUiatPWIekeznYgEf2EOraTRcDPTjy7gIOMtkdpKTaqPk1E68NO5PAGtJahA==",
"license": "MIT",
"dependencies": {
"@buttercup/fetch": "^0.2.1",
"base-64": "^1.0.0",
"byte-length": "^1.0.2",
"entities": "^5.0.0",
"fast-xml-parser": "^4.4.1",
"entities": "^6.0.0",
"fast-xml-parser": "^4.5.1",
"hot-patcher": "^2.0.1",
"layerr": "^3.0.0",
"md5": "^2.3.0",
@ -26597,7 +26600,7 @@
"url-parse": "^1.5.10"
},
"engines": {
"node": ">=16"
"node": ">=14"
}
},
"node_modules/webdav/node_modules/data-uri-to-buffer": {
@ -26610,9 +26613,9 @@
}
},
"node_modules/webdav/node_modules/entities": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/entities/-/entities-5.0.0.tgz",
"integrity": "sha512-BeJFvFRJddxobhvEdm5GqHzRV/X+ACeuw0/BuuxsCh1EUZcAIz8+kYmBp/LrQuloy6K1f3a0M7+IhmZ7QnkISA==",
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/entities/-/entities-6.0.0.tgz",
"integrity": "sha512-aKstq2TDOndCn4diEyp9Uq/Flu2i1GlLkc6XIDQSDMuaFE3OPW5OphLCyQ5SpSJZTb4reN+kTcYru5yIfXoRPw==",
"license": "BSD-2-Clause",
"engines": {
"node": ">=0.12"

View file

@ -116,7 +116,7 @@
"vuedraggable": "^2.24.3",
"vuex": "^3.6.2",
"vuex-router-sync": "^5.0.0",
"webdav": "^5.7.0"
"webdav": "^5.8.0"
},
"devDependencies": {
"@babel/node": "^7.26.0",