@webiny/api-file-manager 5.19.0-beta.5 → 5.19.1
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/package.json +16 -16
- package/plugins/crud/files.crud.js +8 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/api-file-manager",
|
|
3
|
-
"version": "5.19.
|
|
3
|
+
"version": "5.19.1",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"fm:base"
|
|
@@ -20,17 +20,17 @@
|
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@babel/runtime": "7.16.3",
|
|
22
22
|
"@commodo/fields": "1.1.2-beta.20",
|
|
23
|
-
"@webiny/api-i18n-content": "5.19.
|
|
24
|
-
"@webiny/api-security": "5.19.
|
|
25
|
-
"@webiny/api-tenancy": "5.19.
|
|
26
|
-
"@webiny/api-upgrade": "5.19.
|
|
27
|
-
"@webiny/error": "5.19.
|
|
28
|
-
"@webiny/handler": "5.19.
|
|
29
|
-
"@webiny/handler-client": "5.19.
|
|
30
|
-
"@webiny/handler-graphql": "5.19.
|
|
31
|
-
"@webiny/plugins": "5.19.
|
|
32
|
-
"@webiny/project-utils": "5.19.
|
|
33
|
-
"@webiny/validation": "5.19.
|
|
23
|
+
"@webiny/api-i18n-content": "5.19.1",
|
|
24
|
+
"@webiny/api-security": "5.19.1",
|
|
25
|
+
"@webiny/api-tenancy": "5.19.1",
|
|
26
|
+
"@webiny/api-upgrade": "5.19.1",
|
|
27
|
+
"@webiny/error": "5.19.1",
|
|
28
|
+
"@webiny/handler": "5.19.1",
|
|
29
|
+
"@webiny/handler-client": "5.19.1",
|
|
30
|
+
"@webiny/handler-graphql": "5.19.1",
|
|
31
|
+
"@webiny/plugins": "5.19.1",
|
|
32
|
+
"@webiny/project-utils": "5.19.1",
|
|
33
|
+
"@webiny/validation": "5.19.1",
|
|
34
34
|
"aws-sdk": "2.1032.0",
|
|
35
35
|
"commodo-fields-object": "1.0.6",
|
|
36
36
|
"mdbid": "1.0.0",
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
"@babel/plugin-transform-runtime": "^7.5.5",
|
|
45
45
|
"@babel/preset-env": "^7.5.5",
|
|
46
46
|
"@babel/preset-typescript": "^7.0.0",
|
|
47
|
-
"@webiny/api-i18n": "^5.19.
|
|
48
|
-
"@webiny/api-i18n-ddb": "^5.19.
|
|
49
|
-
"@webiny/cli": "^5.19.
|
|
47
|
+
"@webiny/api-i18n": "^5.19.1",
|
|
48
|
+
"@webiny/api-i18n-ddb": "^5.19.1",
|
|
49
|
+
"@webiny/cli": "^5.19.1",
|
|
50
50
|
"jest": "^26.6.3",
|
|
51
51
|
"rimraf": "^3.0.2",
|
|
52
52
|
"ttypescript": "^1.5.12",
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
]
|
|
72
72
|
}
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "1424145d10add470e70fba9c44225656894e0028"
|
|
75
75
|
}
|
|
@@ -107,6 +107,7 @@ const filesContextCrudPlugin = new _ContextPlugin.ContextPlugin(async context =>
|
|
|
107
107
|
const id = (0, _mdbid.default)();
|
|
108
108
|
|
|
109
109
|
const file = _objectSpread(_objectSpread({}, input), {}, {
|
|
110
|
+
tags: Array.isArray(input.tags) ? input.tags : [],
|
|
110
111
|
id,
|
|
111
112
|
meta: _objectSpread({
|
|
112
113
|
private: false
|
|
@@ -164,6 +165,7 @@ const filesContextCrudPlugin = new _ContextPlugin.ContextPlugin(async context =>
|
|
|
164
165
|
checkOwnership(original, permission, context);
|
|
165
166
|
|
|
166
167
|
const file = _objectSpread(_objectSpread(_objectSpread({}, original), input), {}, {
|
|
168
|
+
tags: Array.isArray(input.tags) ? input.tags : Array.isArray(original.tags) ? original.tags : [],
|
|
167
169
|
id: original.id,
|
|
168
170
|
webinyVersion: context.WEBINY_VERSION
|
|
169
171
|
});
|
|
@@ -262,6 +264,7 @@ const filesContextCrudPlugin = new _ContextPlugin.ContextPlugin(async context =>
|
|
|
262
264
|
};
|
|
263
265
|
const files = inputs.map(input => {
|
|
264
266
|
return _objectSpread(_objectSpread({}, input), {}, {
|
|
267
|
+
tags: Array.isArray(input.tags) ? input.tags : [],
|
|
265
268
|
meta: _objectSpread({
|
|
266
269
|
private: false
|
|
267
270
|
}, input.meta || {}),
|
|
@@ -408,10 +411,15 @@ const filesContextCrudPlugin = new _ContextPlugin.ContextPlugin(async context =>
|
|
|
408
411
|
* TODO: use when changing GraphQL output of the tags.
|
|
409
412
|
*/
|
|
410
413
|
const [tags] = await storageOperations.tags(params);
|
|
414
|
+
|
|
415
|
+
if (Array.isArray(tags) === false) {
|
|
416
|
+
return [];
|
|
417
|
+
}
|
|
411
418
|
/**
|
|
412
419
|
* just to keep it standardized, sort by the tag ASC
|
|
413
420
|
*/
|
|
414
421
|
|
|
422
|
+
|
|
415
423
|
return tags.sort();
|
|
416
424
|
} catch (ex) {
|
|
417
425
|
throw new _error.default(ex.message || "Could not search for tags.", ex.code || "FILE_TAG_SEARCH_ERROR", _objectSpread(_objectSpread({}, ex.data || {}), {}, {
|