@webiny/api-file-manager 5.42.0 → 5.42.1-beta.0
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.
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.applyThreatScanning = void 0;
|
|
7
|
+
var _api = require("@webiny/api");
|
|
8
|
+
const applyThreatScanning = context => {
|
|
9
|
+
return (0, _api.decorateContext)(context, {
|
|
10
|
+
createFile: decoratee => (data, meta) => {
|
|
11
|
+
return decoratee({
|
|
12
|
+
...data,
|
|
13
|
+
tags: [...data.tags, "threatScanInProgress"]
|
|
14
|
+
}, meta);
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
exports.applyThreatScanning = applyThreatScanning;
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=applyThreatScanning.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_api","require","applyThreatScanning","context","decorateContext","createFile","decoratee","data","meta","tags","exports"],"sources":["applyThreatScanning.ts"],"sourcesContent":["import type { FileManagerContext } from \"~/types\";\nimport { decorateContext } from \"@webiny/api\";\n\nexport const applyThreatScanning = (context: FileManagerContext[\"fileManager\"]) => {\n return decorateContext(context, {\n createFile: decoratee => (data, meta) => {\n return decoratee(\n {\n ...data,\n tags: [...data.tags, \"threatScanInProgress\"]\n },\n meta\n );\n }\n });\n};\n"],"mappings":";;;;;;AACA,IAAAA,IAAA,GAAAC,OAAA;AAEO,MAAMC,mBAAmB,GAAIC,OAA0C,IAAK;EAC/E,OAAO,IAAAC,oBAAe,EAACD,OAAO,EAAE;IAC5BE,UAAU,EAAEC,SAAS,IAAI,CAACC,IAAI,EAAEC,IAAI,KAAK;MACrC,OAAOF,SAAS,CACZ;QACI,GAAGC,IAAI;QACPE,IAAI,EAAE,CAAC,GAAGF,IAAI,CAACE,IAAI,EAAE,sBAAsB;MAC/C,CAAC,EACDD,IACJ,CAAC;IACL;EACJ,CAAC,CAAC;AACN,CAAC;AAACE,OAAA,CAAAR,mBAAA,GAAAA,mBAAA","ignoreList":[]}
|
package/index.js
CHANGED
|
@@ -13,6 +13,7 @@ var _api = require("@webiny/api");
|
|
|
13
13
|
var _FileManagerContextSetup = require("./FileManagerContextSetup");
|
|
14
14
|
var _setupAssetDelivery = require("./delivery/setupAssetDelivery");
|
|
15
15
|
var _graphql = require("./graphql");
|
|
16
|
+
var _applyThreatScanning = require("./enterprise/applyThreatScanning");
|
|
16
17
|
var _CmsModelModifier = require("./modelModifier/CmsModelModifier");
|
|
17
18
|
Object.keys(_CmsModelModifier).forEach(function (key) {
|
|
18
19
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -55,6 +56,9 @@ const createFileManagerContext = ({
|
|
|
55
56
|
const plugin = new _api.ContextPlugin(async context => {
|
|
56
57
|
const fmContext = new _FileManagerContextSetup.FileManagerContextSetup(context);
|
|
57
58
|
context.fileManager = await fmContext.setupContext(storageOperations);
|
|
59
|
+
if (context.wcp.canUseFileManagerThreatDetection()) {
|
|
60
|
+
context.fileManager = (0, _applyThreatScanning.applyThreatScanning)(context.fileManager);
|
|
61
|
+
}
|
|
58
62
|
});
|
|
59
63
|
plugin.name = "file-manager.createContext";
|
|
60
64
|
return plugin;
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_api","require","_FileManagerContextSetup","_setupAssetDelivery","_graphql","_CmsModelModifier","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_plugins","_delivery","createFileManagerContext","storageOperations","plugin","ContextPlugin","context","fmContext","FileManagerContextSetup","fileManager","setupContext","name","createFileManagerGraphQL","createGraphQLSchemaPlugin","createAssetDelivery","config","setupAssetDelivery"],"sources":["index.ts"],"sourcesContent":["import { ContextPlugin } from \"@webiny/api\";\nimport { FileManagerConfig } from \"~/createFileManager\";\nimport { FileManagerContext } from \"~/types\";\nimport { FileManagerContextSetup } from \"./FileManagerContextSetup\";\nimport { setupAssetDelivery, AssetDeliveryParams } from \"./delivery/setupAssetDelivery\";\nimport { createGraphQLSchemaPlugin } from \"./graphql\";\n\nexport * from \"./modelModifier/CmsModelModifier\";\nexport * from \"./plugins\";\nexport * from \"./delivery\";\n\nexport const createFileManagerContext = ({\n storageOperations\n}: Pick<FileManagerConfig, \"storageOperations\">) => {\n const plugin = new ContextPlugin<FileManagerContext>(async context => {\n const fmContext = new FileManagerContextSetup(context);\n context.fileManager = await fmContext.setupContext(storageOperations);\n });\n\n plugin.name = \"file-manager.createContext\";\n\n return plugin;\n};\n\nexport const createFileManagerGraphQL = () => {\n return createGraphQLSchemaPlugin();\n};\n\nexport const createAssetDelivery = (config: AssetDeliveryParams) => {\n return setupAssetDelivery(config);\n};\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,IAAA,GAAAC,OAAA;AAGA,IAAAC,wBAAA,GAAAD,OAAA;AACA,IAAAE,mBAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;
|
|
1
|
+
{"version":3,"names":["_api","require","_FileManagerContextSetup","_setupAssetDelivery","_graphql","_applyThreatScanning","_CmsModelModifier","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_plugins","_delivery","createFileManagerContext","storageOperations","plugin","ContextPlugin","context","fmContext","FileManagerContextSetup","fileManager","setupContext","wcp","canUseFileManagerThreatDetection","applyThreatScanning","name","createFileManagerGraphQL","createGraphQLSchemaPlugin","createAssetDelivery","config","setupAssetDelivery"],"sources":["index.ts"],"sourcesContent":["import { ContextPlugin } from \"@webiny/api\";\nimport { FileManagerConfig } from \"~/createFileManager\";\nimport { FileManagerContext } from \"~/types\";\nimport { FileManagerContextSetup } from \"./FileManagerContextSetup\";\nimport { setupAssetDelivery, AssetDeliveryParams } from \"./delivery/setupAssetDelivery\";\nimport { createGraphQLSchemaPlugin } from \"./graphql\";\nimport { applyThreatScanning } from \"./enterprise/applyThreatScanning\";\n\nexport * from \"./modelModifier/CmsModelModifier\";\nexport * from \"./plugins\";\nexport * from \"./delivery\";\n\nexport const createFileManagerContext = ({\n storageOperations\n}: Pick<FileManagerConfig, \"storageOperations\">) => {\n const plugin = new ContextPlugin<FileManagerContext>(async context => {\n const fmContext = new FileManagerContextSetup(context);\n context.fileManager = await fmContext.setupContext(storageOperations);\n\n if (context.wcp.canUseFileManagerThreatDetection()) {\n context.fileManager = applyThreatScanning(context.fileManager);\n }\n });\n\n plugin.name = \"file-manager.createContext\";\n\n return plugin;\n};\n\nexport const createFileManagerGraphQL = () => {\n return createGraphQLSchemaPlugin();\n};\n\nexport const createAssetDelivery = (config: AssetDeliveryParams) => {\n return setupAssetDelivery(config);\n};\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,IAAA,GAAAC,OAAA;AAGA,IAAAC,wBAAA,GAAAD,OAAA;AACA,IAAAE,mBAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,oBAAA,GAAAJ,OAAA;AAEA,IAAAK,iBAAA,GAAAL,OAAA;AAAAM,MAAA,CAAAC,IAAA,CAAAF,iBAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,iBAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,iBAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AACA,IAAAS,QAAA,GAAAlB,OAAA;AAAAM,MAAA,CAAAC,IA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WAAW,CAAC;IAClE;EACJ,CAAC,CAAC;EAEFL,MAAM,CAACU,IAAI,GAAG,4BAA4B;EAE1C,OAAOV,MAAM;AACjB,CAAC;AAACR,OAAA,CAAAM,wBAAA,GAAAA,wBAAA;AAEK,MAAMa,wBAAwB,GAAGA,CAAA,KAAM;EAC1C,OAAO,IAAAC,kCAAyB,EAAC,CAAC;AACtC,CAAC;AAACpB,OAAA,CAAAmB,wBAAA,GAAAA,wBAAA;AAEK,MAAME,mBAAmB,GAAIC,MAA2B,IAAK;EAChE,OAAO,IAAAC,sCAAkB,EAACD,MAAM,CAAC;AACrC,CAAC;AAACtB,OAAA,CAAAqB,mBAAA,GAAAA,mBAAA","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/api-file-manager",
|
|
3
|
-
"version": "5.42.0",
|
|
3
|
+
"version": "5.42.1-beta.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"fm:base"
|
|
@@ -18,19 +18,19 @@
|
|
|
18
18
|
],
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@webiny/api": "5.42.0",
|
|
22
|
-
"@webiny/api-headless-cms": "5.42.0",
|
|
23
|
-
"@webiny/api-security": "5.42.0",
|
|
24
|
-
"@webiny/api-tenancy": "5.42.0",
|
|
25
|
-
"@webiny/aws-sdk": "5.42.0",
|
|
26
|
-
"@webiny/error": "5.42.0",
|
|
27
|
-
"@webiny/handler": "5.42.0",
|
|
28
|
-
"@webiny/handler-aws": "5.42.0",
|
|
29
|
-
"@webiny/handler-graphql": "5.42.0",
|
|
30
|
-
"@webiny/plugins": "5.42.0",
|
|
31
|
-
"@webiny/project-utils": "5.42.0",
|
|
32
|
-
"@webiny/pubsub": "5.42.0",
|
|
33
|
-
"@webiny/tasks": "5.42.0",
|
|
21
|
+
"@webiny/api": "5.42.1-beta.0",
|
|
22
|
+
"@webiny/api-headless-cms": "5.42.1-beta.0",
|
|
23
|
+
"@webiny/api-security": "5.42.1-beta.0",
|
|
24
|
+
"@webiny/api-tenancy": "5.42.1-beta.0",
|
|
25
|
+
"@webiny/aws-sdk": "5.42.1-beta.0",
|
|
26
|
+
"@webiny/error": "5.42.1-beta.0",
|
|
27
|
+
"@webiny/handler": "5.42.1-beta.0",
|
|
28
|
+
"@webiny/handler-aws": "5.42.1-beta.0",
|
|
29
|
+
"@webiny/handler-graphql": "5.42.1-beta.0",
|
|
30
|
+
"@webiny/plugins": "5.42.1-beta.0",
|
|
31
|
+
"@webiny/project-utils": "5.42.1-beta.0",
|
|
32
|
+
"@webiny/pubsub": "5.42.1-beta.0",
|
|
33
|
+
"@webiny/tasks": "5.42.1-beta.0",
|
|
34
34
|
"cache-control-parser": "2.0.6",
|
|
35
35
|
"lodash": "4.17.21",
|
|
36
36
|
"object-hash": "3.0.0",
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@types/sharp": "0.32.0",
|
|
41
|
-
"@webiny/api-i18n": "5.42.0",
|
|
42
|
-
"@webiny/cli": "5.42.0",
|
|
43
|
-
"@webiny/utils": "5.42.0",
|
|
41
|
+
"@webiny/api-i18n": "5.42.1-beta.0",
|
|
42
|
+
"@webiny/cli": "5.42.1-beta.0",
|
|
43
|
+
"@webiny/utils": "5.42.1-beta.0",
|
|
44
44
|
"jest": "29.7.0",
|
|
45
45
|
"rimraf": "6.0.1",
|
|
46
46
|
"ttypescript": "1.5.15",
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
]
|
|
65
65
|
}
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "16fb9009f44f242bbc8ba0e02c1d49b1f7ab935b"
|
|
68
68
|
}
|