@webiny/api-file-manager 6.5.0-beta.2 → 6.5.0-beta.4
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.
|
@@ -8,7 +8,8 @@ class FilePrivateModelImpl {
|
|
|
8
8
|
async execute(builder) {
|
|
9
9
|
const model = builder.private({
|
|
10
10
|
modelId: FILE_MODEL_ID,
|
|
11
|
-
name: "FmFile"
|
|
11
|
+
name: "FmFile",
|
|
12
|
+
lifecycleEvents: false
|
|
12
13
|
});
|
|
13
14
|
const privateFiles = this.wcp.canUsePrivateFiles();
|
|
14
15
|
model.fields((fields)=>({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"domain/file/file.model.js","sources":["../../../src/domain/file/file.model.ts"],"sourcesContent":["import { ModelFactory } from \"@webiny/api-headless-cms/features/modelBuilder/index.js\";\nimport { WcpContext } from \"@webiny/api-core/features/wcp/WcpContext/index.js\";\n\nexport const FILE_MODEL_ID = process.env.WEBINY_API_LEGACY_MODELS ? \"fmFile\" : \"wbyFmFile\";\n\nclass FilePrivateModelImpl implements ModelFactory.Interface {\n public constructor(private wcp: WcpContext.Interface) {}\n\n public async execute(builder: ModelFactory.Builder) {\n const model = builder.private({\n modelId: FILE_MODEL_ID,\n name: \"FmFile\"\n });\n const privateFiles = this.wcp.canUsePrivateFiles();\n\n model.fields(fields => ({\n name: fields.text().label(\"Name\").required(\"Value is required.\"),\n key: fields.text().label(\"Key\").required(\"Value is required.\"),\n type: fields.text().label(\"Type\").required(\"Value is required.\"),\n size: fields.number().label(\"Size\").required(\"Value is required.\"),\n metadata: fields\n .object()\n .label(\"Metadata\")\n .renderer(\"hidden\")\n .fields(fields => ({\n image: fields\n .object()\n .label(\"Image\")\n .fields(fields => ({\n width: fields.number().label(\"Width\"),\n height: fields.number().label(\"Height\"),\n format: fields.text().label(\"Format\"),\n orientation: fields.number().label(\"Orientation\"),\n crop: fields.json().label(\"Crop\"),\n focalPoint: fields.json().label(\"Focal point\"),\n alt: fields.text().label(\"Alt text\"),\n caption: fields.text().label(\"Caption\")\n })),\n // Store complete raw EXIF as JSON\n exif: fields.searchableJson().label(\"EXIF Data\"),\n // Store complete raw IPTC as JSON\n iptc: fields.searchableJson().label(\"IPTC Data\")\n })),\n tags: fields\n .text()\n .label(\"Tags\")\n .tags([\"$bulk-edit\"])\n .list()\n .required(\"Value is required.\"),\n description: fields.text().label(\"Description\").defaultValue(\"\")\n }));\n\n if (privateFiles) {\n model.fields(fields => ({\n accessControl: fields\n .object()\n .label(\"Access Control\")\n .tags([\"$bulk-edit\"])\n .fields(fields => ({\n type: fields\n .text()\n .label(\"Type\")\n .predefinedValues([\n {\n label: \"Public\",\n value: \"public\",\n selected: true\n },\n {\n label: \"Private\",\n value: \"private-authenticated\",\n selected: false\n }\n ])\n }))\n }));\n }\n\n return [model];\n }\n}\n\nexport const FileModel = ModelFactory.createImplementation({\n implementation: FilePrivateModelImpl,\n dependencies: [WcpContext]\n});\n"],"names":["FILE_MODEL_ID","process","FilePrivateModelImpl","wcp","builder","model","privateFiles","fields","FileModel","ModelFactory","WcpContext"],"mappings":";;AAGO,MAAMA,gBAAgBC,QAAQ,GAAG,CAAC,wBAAwB,GAAG,WAAW;AAE/E,MAAMC;IACF,YAA2BC,GAAyB,CAAE;aAA3BA,GAAG,GAAHA;IAA4B;IAEvD,MAAa,QAAQC,OAA6B,EAAE;QAChD,MAAMC,QAAQD,QAAQ,OAAO,CAAC;YAC1B,SAASJ;YACT,MAAM;
|
|
1
|
+
{"version":3,"file":"domain/file/file.model.js","sources":["../../../src/domain/file/file.model.ts"],"sourcesContent":["import { ModelFactory } from \"@webiny/api-headless-cms/features/modelBuilder/index.js\";\nimport { WcpContext } from \"@webiny/api-core/features/wcp/WcpContext/index.js\";\n\nexport const FILE_MODEL_ID = process.env.WEBINY_API_LEGACY_MODELS ? \"fmFile\" : \"wbyFmFile\";\n\nclass FilePrivateModelImpl implements ModelFactory.Interface {\n public constructor(private wcp: WcpContext.Interface) {}\n\n public async execute(builder: ModelFactory.Builder) {\n const model = builder.private({\n modelId: FILE_MODEL_ID,\n name: \"FmFile\",\n lifecycleEvents: false\n });\n const privateFiles = this.wcp.canUsePrivateFiles();\n\n model.fields(fields => ({\n name: fields.text().label(\"Name\").required(\"Value is required.\"),\n key: fields.text().label(\"Key\").required(\"Value is required.\"),\n type: fields.text().label(\"Type\").required(\"Value is required.\"),\n size: fields.number().label(\"Size\").required(\"Value is required.\"),\n metadata: fields\n .object()\n .label(\"Metadata\")\n .renderer(\"hidden\")\n .fields(fields => ({\n image: fields\n .object()\n .label(\"Image\")\n .fields(fields => ({\n width: fields.number().label(\"Width\"),\n height: fields.number().label(\"Height\"),\n format: fields.text().label(\"Format\"),\n orientation: fields.number().label(\"Orientation\"),\n crop: fields.json().label(\"Crop\"),\n focalPoint: fields.json().label(\"Focal point\"),\n alt: fields.text().label(\"Alt text\"),\n caption: fields.text().label(\"Caption\")\n })),\n // Store complete raw EXIF as JSON\n exif: fields.searchableJson().label(\"EXIF Data\"),\n // Store complete raw IPTC as JSON\n iptc: fields.searchableJson().label(\"IPTC Data\")\n })),\n tags: fields\n .text()\n .label(\"Tags\")\n .tags([\"$bulk-edit\"])\n .list()\n .required(\"Value is required.\"),\n description: fields.text().label(\"Description\").defaultValue(\"\")\n }));\n\n if (privateFiles) {\n model.fields(fields => ({\n accessControl: fields\n .object()\n .label(\"Access Control\")\n .tags([\"$bulk-edit\"])\n .fields(fields => ({\n type: fields\n .text()\n .label(\"Type\")\n .predefinedValues([\n {\n label: \"Public\",\n value: \"public\",\n selected: true\n },\n {\n label: \"Private\",\n value: \"private-authenticated\",\n selected: false\n }\n ])\n }))\n }));\n }\n\n return [model];\n }\n}\n\nexport const FileModel = ModelFactory.createImplementation({\n implementation: FilePrivateModelImpl,\n dependencies: [WcpContext]\n});\n"],"names":["FILE_MODEL_ID","process","FilePrivateModelImpl","wcp","builder","model","privateFiles","fields","FileModel","ModelFactory","WcpContext"],"m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C;gBACJ,MAAMA,OACD,IAAI,GACJ,KAAK,CAAC,QACN,IAAI,CAAC;oBAAC;iBAAa,EACnB,IAAI,GACJ,QAAQ,CAAC;gBACd,aAAaA,OAAO,IAAI,GAAG,KAAK,CAAC,eAAe,YAAY,CAAC;YACjE;QAEA,IAAID,cACAD,MAAM,MAAM,CAACE,CAAAA,SAAW;gBACpB,eAAeA,OACV,MAAM,GACN,KAAK,CAAC,kBACN,IAAI,CAAC;oBAAC;iBAAa,EACnB,MAAM,CAACA,CAAAA,SAAW;wBACf,MAAMA,OACD,IAAI,GACJ,KAAK,CAAC,QACN,gBAAgB,CAAC;4BACd;gCACI,OAAO;gCACP,OAAO;gCACP,UAAU;4BACd;4BACA;gCACI,OAAO;gCACP,OAAO;gCACP,UAAU;4BACd;yBACH;oBACT;YACR;QAGJ,OAAO;YAACF;SAAM;IAClB;AACJ;AAEO,MAAMG,YAAYC,aAAa,oBAAoB,CAAC;IACvD,gBAAgBP;IAChB,cAAc;QAACQ;KAAW;AAC9B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/api-file-manager",
|
|
3
|
-
"version": "6.5.0-beta.
|
|
3
|
+
"version": "6.5.0-beta.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./index.js",
|
|
@@ -22,19 +22,19 @@
|
|
|
22
22
|
],
|
|
23
23
|
"license": "MIT",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@webiny/api": "6.5.0-beta.
|
|
26
|
-
"@webiny/api-core": "6.5.0-beta.
|
|
27
|
-
"@webiny/api-headless-cms": "6.5.0-beta.
|
|
28
|
-
"@webiny/background-tasks": "6.5.0-beta.
|
|
29
|
-
"@webiny/build-tools": "6.5.0-beta.
|
|
25
|
+
"@webiny/api": "6.5.0-beta.4",
|
|
26
|
+
"@webiny/api-core": "6.5.0-beta.4",
|
|
27
|
+
"@webiny/api-headless-cms": "6.5.0-beta.4",
|
|
28
|
+
"@webiny/background-tasks": "6.5.0-beta.4",
|
|
29
|
+
"@webiny/build-tools": "6.5.0-beta.4",
|
|
30
30
|
"@webiny/di": "1.0.2",
|
|
31
|
-
"@webiny/error": "6.5.0-beta.
|
|
32
|
-
"@webiny/feature": "6.5.0-beta.
|
|
33
|
-
"@webiny/handler": "6.5.0-beta.
|
|
34
|
-
"@webiny/handler-graphql": "6.5.0-beta.
|
|
35
|
-
"@webiny/plugins": "6.5.0-beta.
|
|
36
|
-
"@webiny/utils": "6.5.0-beta.
|
|
37
|
-
"@webiny/wcp": "6.5.0-beta.
|
|
31
|
+
"@webiny/error": "6.5.0-beta.4",
|
|
32
|
+
"@webiny/feature": "6.5.0-beta.4",
|
|
33
|
+
"@webiny/handler": "6.5.0-beta.4",
|
|
34
|
+
"@webiny/handler-graphql": "6.5.0-beta.4",
|
|
35
|
+
"@webiny/plugins": "6.5.0-beta.4",
|
|
36
|
+
"@webiny/utils": "6.5.0-beta.4",
|
|
37
|
+
"@webiny/wcp": "6.5.0-beta.4",
|
|
38
38
|
"cache-control-parser": "2.2.0",
|
|
39
39
|
"mime": "4.1.0",
|
|
40
40
|
"object-hash": "3.0.0",
|
|
@@ -45,9 +45,9 @@
|
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/object-hash": "3.0.6",
|
|
48
|
-
"@webiny/handler-aws": "6.5.0-beta.
|
|
49
|
-
"@webiny/project-utils": "6.5.0-beta.
|
|
50
|
-
"@webiny/wcp": "6.5.0-beta.
|
|
48
|
+
"@webiny/handler-aws": "6.5.0-beta.4",
|
|
49
|
+
"@webiny/project-utils": "6.5.0-beta.4",
|
|
50
|
+
"@webiny/wcp": "6.5.0-beta.4",
|
|
51
51
|
"rimraf": "6.1.3",
|
|
52
52
|
"typescript": "7.0.2"
|
|
53
53
|
},
|