@webiny/api-file-manager 6.5.0-beta.3 → 6.5.0-beta.5

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;QACV;QACA,MAAMM,eAAe,IAAI,CAAC,GAAG,CAAC,kBAAkB;QAEhDD,MAAM,MAAM,CAACE,CAAAA,SAAW;gBACpB,MAAMA,OAAO,IAAI,GAAG,KAAK,CAAC,QAAQ,QAAQ,CAAC;gBAC3C,KAAKA,OAAO,IAAI,GAAG,KAAK,CAAC,OAAO,QAAQ,CAAC;gBACzC,MAAMA,OAAO,IAAI,GAAG,KAAK,CAAC,QAAQ,QAAQ,CAAC;gBAC3C,MAAMA,OAAO,MAAM,GAAG,KAAK,CAAC,QAAQ,QAAQ,CAAC;gBAC7C,UAAUA,OAC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AC9B"}
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"],"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;YACN,iBAAiB;QACrB;QACA,MAAMM,eAAe,IAAI,CAAC,GAAG,CAAC,kBAAkB;QAEhDD,MAAM,MAAM,CAACE,CAAAA,SAAW;gBACpB,MAAMA,OAAO,IAAI,GAAG,KAAK,CAAC,QAAQ,QAAQ,CAAC;gBAC3C,KAAKA,OAAO,IAAI,GAAG,KAAK,CAAC,OAAO,QAAQ,CAAC;gBACzC,MAAMA,OAAO,IAAI,GAAG,KAAK,CAAC,QAAQ,QAAQ,CAAC;gBAC3C,MAAMA,OAAO,MAAM,GAAG,KAAK,CAAC,QAAQ,QAAQ,CAAC;gBAC7C,UAAUA,OACL,MAAM,GACN,KAAK,CAAC,YACN,QAAQ,CAAC,UACT,MAAM,CAACA,CAAAA,SAAW;wBACf,OAAOA,OACF,MAAM,GACN,KAAK,CAAC,SACN,MAAM,CAACA,CAAAA,SAAW;gCACf,OAAOA,OAAO,MAAM,GAAG,KAAK,CAAC;gCAC7B,QAAQA,OAAO,MAAM,GAAG,KAAK,CAAC;gCAC9B,QAAQA,OAAO,IAAI,GAAG,KAAK,CAAC;gCAC5B,aAAaA,OAAO,MAAM,GAAG,KAAK,CAAC;gCACnC,MAAMA,OAAO,IAAI,GAAG,KAAK,CAAC;gCAC1B,YAAYA,OAAO,IAAI,GAAG,KAAK,CAAC;gCAChC,KAAKA,OAAO,IAAI,GAAG,KAAK,CAAC;gCACzB,SAASA,OAAO,IAAI,GAAG,KAAK,CAAC;4BACjC;wBAEJ,MAAMA,OAAO,cAAc,GAAG,KAAK,CAAC;wBAEpC,MAAMA,OAAO,cAAc,GAAG,KAAK,CAAC;oBACxC;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"}
@@ -3,7 +3,7 @@ const normalizeImageOptions = (query, acceptHeader)=>{
3
3
  const result = {
4
4
  original: "original" in query
5
5
  };
6
- const width = query.width ? parseInt(query.width, 10) : NaN;
6
+ const width = query.width ? parseInt(query.width, 10) : 0 / 0;
7
7
  if (!Number.isNaN(width) && width > 0) result.width = width;
8
8
  const quality = void 0 !== query.quality ? clampQuality(parseInt(query.quality, 10)) : void 0;
9
9
  if (void 0 !== quality) result.quality = quality;
@@ -1 +1 @@
1
- {"version":3,"file":"features/assetDelivery/assetTypes/image/normalizeImageOptions.js","sources":["../../../../../src/features/assetDelivery/assetTypes/image/normalizeImageOptions.ts"],"sourcesContent":["import type { ImageRequestOptions } from \"./imageTypes.js\";\nimport { clampQuality, resolveRequestedFormat } from \"./imageFormat.js\";\n\n/**\n * Parse raw query params into typed image request options.\n * Returns a new `ImageRequestOptions` object; does not mutate the input.\n */\nexport const normalizeImageOptions = (\n query: Record<string, any>,\n acceptHeader: string | undefined\n): ImageRequestOptions => {\n const result: ImageRequestOptions = {\n original: \"original\" in query\n };\n\n const width = query.width ? parseInt(query.width, 10) : NaN;\n if (!Number.isNaN(width) && width > 0) {\n result.width = width;\n }\n\n const quality =\n query.quality !== undefined ? clampQuality(parseInt(query.quality, 10)) : undefined;\n if (quality !== undefined) {\n result.quality = quality;\n }\n\n const format = resolveRequestedFormat(query.format, acceptHeader);\n if (format) {\n result.format = format;\n }\n\n const crop = parseCrop(query.crop);\n if (crop) {\n result.crop = crop;\n }\n\n const aspectRatio = parseAspectRatio(query.aspectRatio);\n if (aspectRatio) {\n result.aspectRatio = aspectRatio;\n }\n\n const focal = parseFocal(query.focal);\n if (focal) {\n result.focal = focal;\n }\n\n return result;\n};\n\nconst parseAspectRatio = (raw: unknown): number | undefined => {\n if (typeof raw !== \"string\") {\n return undefined;\n }\n if (raw.includes(\":\")) {\n const [w, h] = raw.split(\":\").map(v => parseFloat(v));\n return w > 0 && h > 0 ? w / h : undefined;\n }\n const value = parseFloat(raw);\n return !Number.isNaN(value) && value > 0 ? value : undefined;\n};\n\nconst parseFocal = (raw: unknown): { x: number; y: number } | undefined => {\n if (typeof raw !== \"string\") {\n return undefined;\n }\n const parts = raw.split(\",\").map(v => parseFloat(v));\n if (parts.length !== 2 || parts.some(n => Number.isNaN(n))) {\n return undefined;\n }\n const clamp01 = (n: number) => Math.min(1, Math.max(0, n));\n return { x: clamp01(parts[0]), y: clamp01(parts[1]) };\n};\n\nconst parseCrop = (\n raw: unknown\n): { top: number; left: number; bottom: number; right: number } | undefined => {\n if (typeof raw !== \"string\") {\n return undefined;\n }\n const parts = raw.split(\",\").map(v => parseFloat(v));\n if (parts.length !== 4 || parts.some(n => Number.isNaN(n))) {\n return undefined;\n }\n const clamp01 = (n: number) => Math.min(1, Math.max(0, n));\n const [top, left, bottom, right] = parts.map(clamp01);\n if (top === 0 && left === 0 && bottom === 0 && right === 0) {\n return undefined;\n }\n if (top + bottom >= 1 || left + right >= 1) {\n return undefined;\n }\n return { top, left, bottom, right };\n};\n"],"names":["normalizeImageOptions","query","acceptHeader","result","width","parseInt","NaN","Number","quality","undefined","clampQuality","format","resolveRequestedFormat","crop","parseCrop","aspectRatio","parseAspectRatio","focal","parseFocal","raw","w","h","v","parseFloat","value","parts","n","clamp01","Math","top","left","bottom","right"],"mappings":";AAOO,MAAMA,wBAAwB,CACjCC,OACAC;IAEA,MAAMC,SAA8B;QAChC,UAAU,cAAcF;IAC5B;IAEA,MAAMG,QAAQH,MAAM,KAAK,GAAGI,SAASJ,MAAM,KAAK,EAAE,MAAMK;IACxD,IAAI,CAACC,OAAO,KAAK,CAACH,UAAUA,QAAQ,GAChCD,OAAO,KAAK,GAAGC;IAGnB,MAAMI,UACFP,AAAkBQ,WAAlBR,MAAM,OAAO,GAAiBS,aAAaL,SAASJ,MAAM,OAAO,EAAE,OAAOQ;IAC9E,IAAID,AAAYC,WAAZD,SACAL,OAAO,OAAO,GAAGK;IAGrB,MAAMG,SAASC,uBAAuBX,MAAM,MAAM,EAAEC;IACpD,IAAIS,QACAR,OAAO,MAAM,GAAGQ;IAGpB,MAAME,OAAOC,UAAUb,MAAM,IAAI;IACjC,IAAIY,MACAV,OAAO,IAAI,GAAGU;IAGlB,MAAME,cAAcC,iBAAiBf,MAAM,WAAW;IACtD,IAAIc,aACAZ,OAAO,WAAW,GAAGY;IAGzB,MAAME,QAAQC,WAAWjB,MAAM,KAAK;IACpC,IAAIgB,OACAd,OAAO,KAAK,GAAGc;IAGnB,OAAOd;AACX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,AAAS,MAATA,QAAcC,AAAW,MAAXA,UAAgBC,AAAU,MAAVA,OAC3C;IAEJ,IAAIH,MAAME,UAAU,KAAKD,OAAOE,SAAS,GACrC;IAEJ,OAAO;QAAEH;QAAKC;QAAMC;QAAQC;IAAM;AACtC"}
1
+ {"version":3,"file":"features/assetDelivery/assetTypes/image/normalizeImageOptions.js","sources":["../../../../../src/features/assetDelivery/assetTypes/image/normalizeImageOptions.ts"],"sourcesContent":["import type { ImageRequestOptions } from \"./imageTypes.js\";\nimport { clampQuality, resolveRequestedFormat } from \"./imageFormat.js\";\n\n/**\n * Parse raw query params into typed image request options.\n * Returns a new `ImageRequestOptions` object; does not mutate the input.\n */\nexport const normalizeImageOptions = (\n query: Record<string, any>,\n acceptHeader: string | undefined\n): ImageRequestOptions => {\n const result: ImageRequestOptions = {\n original: \"original\" in query\n };\n\n const width = query.width ? parseInt(query.width, 10) : NaN;\n if (!Number.isNaN(width) && width > 0) {\n result.width = width;\n }\n\n const quality =\n query.quality !== undefined ? clampQuality(parseInt(query.quality, 10)) : undefined;\n if (quality !== undefined) {\n result.quality = quality;\n }\n\n const format = resolveRequestedFormat(query.format, acceptHeader);\n if (format) {\n result.format = format;\n }\n\n const crop = parseCrop(query.crop);\n if (crop) {\n result.crop = crop;\n }\n\n const aspectRatio = parseAspectRatio(query.aspectRatio);\n if (aspectRatio) {\n result.aspectRatio = aspectRatio;\n }\n\n const focal = parseFocal(query.focal);\n if (focal) {\n result.focal = focal;\n }\n\n return result;\n};\n\nconst parseAspectRatio = (raw: unknown): number | undefined => {\n if (typeof raw !== \"string\") {\n return undefined;\n }\n if (raw.includes(\":\")) {\n const [w, h] = raw.split(\":\").map(v => parseFloat(v));\n return w > 0 && h > 0 ? w / h : undefined;\n }\n const value = parseFloat(raw);\n return !Number.isNaN(value) && value > 0 ? value : undefined;\n};\n\nconst parseFocal = (raw: unknown): { x: number; y: number } | undefined => {\n if (typeof raw !== \"string\") {\n return undefined;\n }\n const parts = raw.split(\",\").map(v => parseFloat(v));\n if (parts.length !== 2 || parts.some(n => Number.isNaN(n))) {\n return undefined;\n }\n const clamp01 = (n: number) => Math.min(1, Math.max(0, n));\n return { x: clamp01(parts[0]), y: clamp01(parts[1]) };\n};\n\nconst parseCrop = (\n raw: unknown\n): { top: number; left: number; bottom: number; right: number } | undefined => {\n if (typeof raw !== \"string\") {\n return undefined;\n }\n const parts = raw.split(\",\").map(v => parseFloat(v));\n if (parts.length !== 4 || parts.some(n => Number.isNaN(n))) {\n return undefined;\n }\n const clamp01 = (n: number) => Math.min(1, Math.max(0, n));\n const [top, left, bottom, right] = parts.map(clamp01);\n if (top === 0 && left === 0 && bottom === 0 && right === 0) {\n return undefined;\n }\n if (top + bottom >= 1 || left + right >= 1) {\n return undefined;\n }\n return { top, left, bottom, right };\n};\n"],"names":["normalizeImageOptions","query","acceptHeader","result","width","parseInt","NaN","Number","quality","undefined","clampQuality","format","resolveRequestedFormat","crop","parseCrop","aspectRatio","parseAspectRatio","focal","parseFocal","raw","w","h","v","parseFloat","value","parts","n","clamp01","Math","top","left","bottom","right"],"mappings":";AAOO,MAAMA,wBAAwB,CACjCC,OACAC;IAEA,MAAMC,SAA8B;QAChC,UAAU,cAAcF;IAC5B;IAEA,MAAMG,QAAQH,MAAM,KAAK,GAAGI,SAASJ,MAAM,KAAK,EAAE,MAAMK,KAAG;IAC3D,IAAI,CAACC,OAAO,KAAK,CAACH,UAAUA,QAAQ,GAChCD,OAAO,KAAK,GAAGC;IAGnB,MAAMI,UACFP,AAAkBQ,WAAlBR,MAAM,OAAO,GAAiBS,aAAaL,SAASJ,MAAM,OAAO,EAAE,OAAOQ;IAC9E,IAAID,AAAYC,WAAZD,SACAL,OAAO,OAAO,GAAGK;IAGrB,MAAMG,SAASC,uBAAuBX,MAAM,MAAM,EAAEC;IACpD,IAAIS,QACAR,OAAO,MAAM,GAAGQ;IAGpB,MAAME,OAAOC,UAAUb,MAAM,IAAI;IACjC,IAAIY,MACAV,OAAO,IAAI,GA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J,MAAMC,UAAU,CAACD,IAAcE,KAAK,GAAG,CAAC,GAAGA,KAAK,GAAG,CAAC,GAAGF;IACvD,MAAM,CAACG,KAAKC,MAAMC,QAAQC,MAAM,GAAGP,MAAM,GAAG,CAACE;IAC7C,IAAIE,AAAQ,MAARA,OAAaC,AAAS,MAATA,QAAcC,AAAW,MAAXA,UAAgBC,AAAU,MAAVA,OAC3C;IAEJ,IAAIH,MAAME,UAAU,KAAKD,OAAOE,SAAS,GACrC;IAEJ,OAAO;QAAEH;QAAKC;QAAMC;QAAQC;IAAM;AACtC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/api-file-manager",
3
- "version": "6.5.0-beta.3",
3
+ "version": "6.5.0-beta.5",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./index.js",
@@ -22,32 +22,32 @@
22
22
  ],
23
23
  "license": "MIT",
24
24
  "dependencies": {
25
- "@webiny/api": "6.5.0-beta.3",
26
- "@webiny/api-core": "6.5.0-beta.3",
27
- "@webiny/api-headless-cms": "6.5.0-beta.3",
28
- "@webiny/background-tasks": "6.5.0-beta.3",
29
- "@webiny/build-tools": "6.5.0-beta.3",
30
- "@webiny/di": "1.0.2",
31
- "@webiny/error": "6.5.0-beta.3",
32
- "@webiny/feature": "6.5.0-beta.3",
33
- "@webiny/handler": "6.5.0-beta.3",
34
- "@webiny/handler-graphql": "6.5.0-beta.3",
35
- "@webiny/plugins": "6.5.0-beta.3",
36
- "@webiny/utils": "6.5.0-beta.3",
37
- "@webiny/wcp": "6.5.0-beta.3",
25
+ "@webiny/api": "6.5.0-beta.5",
26
+ "@webiny/api-core": "6.5.0-beta.5",
27
+ "@webiny/api-headless-cms": "6.5.0-beta.5",
28
+ "@webiny/background-tasks": "6.5.0-beta.5",
29
+ "@webiny/build-tools": "6.5.0-beta.5",
30
+ "@webiny/di": "1.1.0",
31
+ "@webiny/error": "6.5.0-beta.5",
32
+ "@webiny/feature": "6.5.0-beta.5",
33
+ "@webiny/handler": "6.5.0-beta.5",
34
+ "@webiny/handler-graphql": "6.5.0-beta.5",
35
+ "@webiny/plugins": "6.5.0-beta.5",
36
+ "@webiny/utils": "6.5.0-beta.5",
37
+ "@webiny/wcp": "6.5.0-beta.5",
38
38
  "cache-control-parser": "2.2.0",
39
39
  "mime": "4.1.0",
40
40
  "object-hash": "3.0.0",
41
- "p-map": "7.0.6",
41
+ "p-map": "7.0.8",
42
42
  "p-reduce": "3.0.0",
43
43
  "sanitize-filename": "1.6.4",
44
- "zod": "4.4.3"
44
+ "zod": "4.6.5"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@types/object-hash": "3.0.6",
48
- "@webiny/handler-aws": "6.5.0-beta.3",
49
- "@webiny/project-utils": "6.5.0-beta.3",
50
- "@webiny/wcp": "6.5.0-beta.3",
48
+ "@webiny/handler-aws": "6.5.0-beta.5",
49
+ "@webiny/project-utils": "6.5.0-beta.5",
50
+ "@webiny/wcp": "6.5.0-beta.5",
51
51
  "rimraf": "6.1.3",
52
52
  "typescript": "7.0.2"
53
53
  },