@strapi/upload 5.4.2 → 5.5.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.
Files changed (31) hide show
  1. package/dist/_chunks/{App-BnJnub6y.mjs → App-CnKRJSFI.mjs} +3 -3
  2. package/dist/_chunks/{App-BnJnub6y.mjs.map → App-CnKRJSFI.mjs.map} +1 -1
  3. package/dist/_chunks/{App-B_qq8rgN.js → App-DvNA8DcO.js} +4 -5
  4. package/dist/_chunks/{App-B_qq8rgN.js.map → App-DvNA8DcO.js.map} +1 -1
  5. package/dist/_chunks/{ConfigureTheView-MSDjw9SU.mjs → ConfigureTheView-BiYrBNO5.mjs} +2 -2
  6. package/dist/_chunks/{ConfigureTheView-MSDjw9SU.mjs.map → ConfigureTheView-BiYrBNO5.mjs.map} +1 -1
  7. package/dist/_chunks/{ConfigureTheView-vQ7SyJK-.js → ConfigureTheView-CgkgNQgk.js} +3 -4
  8. package/dist/_chunks/{ConfigureTheView-vQ7SyJK-.js.map → ConfigureTheView-CgkgNQgk.js.map} +1 -1
  9. package/dist/_chunks/{SettingsPage-NQUNwQi_.mjs → SettingsPage-B0kz2mu3.mjs} +2 -2
  10. package/dist/_chunks/{SettingsPage-NQUNwQi_.mjs.map → SettingsPage-B0kz2mu3.mjs.map} +1 -1
  11. package/dist/_chunks/{SettingsPage-C5mG_qOn.js → SettingsPage-BBl5rnJi.js} +3 -4
  12. package/dist/_chunks/{SettingsPage-C5mG_qOn.js.map → SettingsPage-BBl5rnJi.js.map} +1 -1
  13. package/dist/_chunks/{graphql-68BJxih-.mjs → graphql-DMPTPlvx.mjs} +2 -2
  14. package/dist/_chunks/{graphql-68BJxih-.mjs.map → graphql-DMPTPlvx.mjs.map} +1 -1
  15. package/dist/_chunks/{graphql-DkkRswQX.js → graphql-QF5Y36Qj.js} +2 -2
  16. package/dist/_chunks/{graphql-DkkRswQX.js.map → graphql-QF5Y36Qj.js.map} +1 -1
  17. package/dist/_chunks/{index-DR3Ggk1w.mjs → index-B2N2JGA2.mjs} +67 -48
  18. package/dist/_chunks/index-B2N2JGA2.mjs.map +1 -0
  19. package/dist/_chunks/{index-BDq2waDf.js → index-D57iKFts.js} +9 -16
  20. package/dist/_chunks/{index-BDq2waDf.js.map → index-D57iKFts.js.map} +1 -1
  21. package/dist/_chunks/{index-Bc0RmE2T.js → index-jOutXPCm.js} +59 -40
  22. package/dist/_chunks/index-jOutXPCm.js.map +1 -0
  23. package/dist/_chunks/{index-BGwOh3pn.mjs → index-sOlgMDiZ.mjs} +9 -16
  24. package/dist/_chunks/{index-BGwOh3pn.mjs.map → index-sOlgMDiZ.mjs.map} +1 -1
  25. package/dist/admin/index.js +1 -1
  26. package/dist/admin/index.mjs +1 -1
  27. package/dist/server/index.js +1 -1
  28. package/dist/server/index.mjs +1 -1
  29. package/package.json +10 -9
  30. package/dist/_chunks/index-Bc0RmE2T.js.map +0 -1
  31. package/dist/_chunks/index-DR3Ggk1w.mjs.map +0 -1
@@ -315,7 +315,7 @@ async function register({ strapi: strapi2 }) {
315
315
  strapi2.plugin("upload").provider = createProvider(strapi2.config.get("plugin::upload"));
316
316
  await registerUploadMiddleware({ strapi: strapi2 });
317
317
  if (strapi2.plugin("graphql")) {
318
- const { installGraphqlExtension } = await import("./graphql-68BJxih-.mjs");
318
+ const { installGraphqlExtension } = await import("./graphql-DMPTPlvx.mjs");
319
319
  installGraphqlExtension({ strapi: strapi2 });
320
320
  }
321
321
  if (strapi2.plugin("documentation")) {
@@ -905,8 +905,7 @@ const upload = ({ strapi: strapi2 }) => {
905
905
  const formats = await generateResponsiveFormats2(fileData);
906
906
  if (Array.isArray(formats) && formats.length > 0) {
907
907
  for (const format of formats) {
908
- if (!format)
909
- continue;
908
+ if (!format) continue;
910
909
  uploadPromises.push(uploadResponsiveFormat(format));
911
910
  }
912
911
  }
@@ -1208,8 +1207,7 @@ const DEFAULT_BREAKPOINTS = {
1208
1207
  const getBreakpoints = () => strapi.config.get("plugin::upload.breakpoints", DEFAULT_BREAKPOINTS);
1209
1208
  const generateResponsiveFormats = async (file2) => {
1210
1209
  const { responsiveDimensions = false } = await getService("upload").getSettings() ?? {};
1211
- if (!responsiveDimensions)
1212
- return [];
1210
+ if (!responsiveDimensions) return [];
1213
1211
  const originalDimensions = await getDimensions(file2);
1214
1212
  const breakpoints = getBreakpoints();
1215
1213
  return Promise.all(
@@ -1459,8 +1457,7 @@ const folder = {
1459
1457
  getStructure
1460
1458
  };
1461
1459
  const getFolderPath = async (folderId) => {
1462
- if (!folderId)
1463
- return "/";
1460
+ if (!folderId) return "/";
1464
1461
  const parentFolder = await strapi.db.query(FOLDER_MODEL_UID).findOne({ where: { id: folderId } });
1465
1462
  return parentFolder.path;
1466
1463
  };
@@ -2072,8 +2069,7 @@ const validateUpdateFolderSchema = (id) => yup.object().shape({
2072
2069
  "dont-move-inside-self",
2073
2070
  "folder cannot be moved inside itself",
2074
2071
  async function test(parent) {
2075
- if (isNil(parent))
2076
- return true;
2072
+ if (isNil(parent)) return true;
2077
2073
  const destinationFolder = await strapi.db.query(FOLDER_MODEL_UID).findOne({
2078
2074
  select: ["path"],
2079
2075
  where: { id: parent }
@@ -2082,8 +2078,7 @@ const validateUpdateFolderSchema = (id) => yup.object().shape({
2082
2078
  select: ["path"],
2083
2079
  where: { id }
2084
2080
  });
2085
- if (!destinationFolder || !currentFolder)
2086
- return true;
2081
+ if (!destinationFolder || !currentFolder) return true;
2087
2082
  return !isFolderOrChild(destinationFolder, currentFolder);
2088
2083
  }
2089
2084
  )
@@ -2205,8 +2200,7 @@ const validateStructureMoveManyFoldersFilesSchema = yup.object().shape({
2205
2200
  }).noUnknown().required();
2206
2201
  const validateDuplicatesMoveManyFoldersFilesSchema = yup.object().test("are-folders-unique", "some folders already exist", async function areFoldersUnique(value) {
2207
2202
  const { folderIds, destinationFolderId } = value;
2208
- if (isEmpty(folderIds))
2209
- return true;
2203
+ if (isEmpty(folderIds)) return true;
2210
2204
  const folders = await strapi.db.query(FOLDER_MODEL_UID).findMany({
2211
2205
  select: ["name"],
2212
2206
  where: { id: { $in: folderIds } }
@@ -2228,8 +2222,7 @@ const validateMoveFoldersNotInsideThemselvesSchema = yup.object().test(
2228
2222
  "folders cannot be moved inside themselves or one of its children",
2229
2223
  async function validateMoveFoldersNotInsideThemselves(value) {
2230
2224
  const { folderIds, destinationFolderId } = value;
2231
- if (destinationFolderId === null || isEmpty(folderIds))
2232
- return true;
2225
+ if (destinationFolderId === null || isEmpty(folderIds)) return true;
2233
2226
  const destinationFolder = await strapi.db.query(FOLDER_MODEL_UID).findOne({
2234
2227
  select: ["path"],
2235
2228
  where: { id: destinationFolderId }
@@ -2715,4 +2708,4 @@ export {
2715
2708
  FILE_MODEL_UID as F,
2716
2709
  index as i
2717
2710
  };
2718
- //# sourceMappingURL=index-BGwOh3pn.mjs.map
2711
+ //# sourceMappingURL=index-sOlgMDiZ.mjs.map