@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
@@ -327,7 +327,7 @@ async function register({ strapi: strapi2 }) {
327
327
  strapi2.plugin("upload").provider = createProvider(strapi2.config.get("plugin::upload"));
328
328
  await registerUploadMiddleware({ strapi: strapi2 });
329
329
  if (strapi2.plugin("graphql")) {
330
- const { installGraphqlExtension } = await Promise.resolve().then(() => require("./graphql-DkkRswQX.js"));
330
+ const { installGraphqlExtension } = await Promise.resolve().then(() => require("./graphql-QF5Y36Qj.js"));
331
331
  installGraphqlExtension({ strapi: strapi2 });
332
332
  }
333
333
  if (strapi2.plugin("documentation")) {
@@ -917,8 +917,7 @@ const upload = ({ strapi: strapi2 }) => {
917
917
  const formats = await generateResponsiveFormats2(fileData);
918
918
  if (Array.isArray(formats) && formats.length > 0) {
919
919
  for (const format of formats) {
920
- if (!format)
921
- continue;
920
+ if (!format) continue;
922
921
  uploadPromises.push(uploadResponsiveFormat(format));
923
922
  }
924
923
  }
@@ -1220,8 +1219,7 @@ const DEFAULT_BREAKPOINTS = {
1220
1219
  const getBreakpoints = () => strapi.config.get("plugin::upload.breakpoints", DEFAULT_BREAKPOINTS);
1221
1220
  const generateResponsiveFormats = async (file2) => {
1222
1221
  const { responsiveDimensions = false } = await getService("upload").getSettings() ?? {};
1223
- if (!responsiveDimensions)
1224
- return [];
1222
+ if (!responsiveDimensions) return [];
1225
1223
  const originalDimensions = await getDimensions(file2);
1226
1224
  const breakpoints = getBreakpoints();
1227
1225
  return Promise.all(
@@ -1471,8 +1469,7 @@ const folder = {
1471
1469
  getStructure
1472
1470
  };
1473
1471
  const getFolderPath = async (folderId) => {
1474
- if (!folderId)
1475
- return "/";
1472
+ if (!folderId) return "/";
1476
1473
  const parentFolder = await strapi.db.query(FOLDER_MODEL_UID).findOne({ where: { id: folderId } });
1477
1474
  return parentFolder.path;
1478
1475
  };
@@ -2084,8 +2081,7 @@ const validateUpdateFolderSchema = (id) => utils.yup.object().shape({
2084
2081
  "dont-move-inside-self",
2085
2082
  "folder cannot be moved inside itself",
2086
2083
  async function test(parent) {
2087
- if (fp.isNil(parent))
2088
- return true;
2084
+ if (fp.isNil(parent)) return true;
2089
2085
  const destinationFolder = await strapi.db.query(FOLDER_MODEL_UID).findOne({
2090
2086
  select: ["path"],
2091
2087
  where: { id: parent }
@@ -2094,8 +2090,7 @@ const validateUpdateFolderSchema = (id) => utils.yup.object().shape({
2094
2090
  select: ["path"],
2095
2091
  where: { id }
2096
2092
  });
2097
- if (!destinationFolder || !currentFolder)
2098
- return true;
2093
+ if (!destinationFolder || !currentFolder) return true;
2099
2094
  return !isFolderOrChild(destinationFolder, currentFolder);
2100
2095
  }
2101
2096
  )
@@ -2217,8 +2212,7 @@ const validateStructureMoveManyFoldersFilesSchema = utils.yup.object().shape({
2217
2212
  }).noUnknown().required();
2218
2213
  const validateDuplicatesMoveManyFoldersFilesSchema = utils.yup.object().test("are-folders-unique", "some folders already exist", async function areFoldersUnique(value) {
2219
2214
  const { folderIds, destinationFolderId } = value;
2220
- if (fp.isEmpty(folderIds))
2221
- return true;
2215
+ if (fp.isEmpty(folderIds)) return true;
2222
2216
  const folders = await strapi.db.query(FOLDER_MODEL_UID).findMany({
2223
2217
  select: ["name"],
2224
2218
  where: { id: { $in: folderIds } }
@@ -2240,8 +2234,7 @@ const validateMoveFoldersNotInsideThemselvesSchema = utils.yup.object().test(
2240
2234
  "folders cannot be moved inside themselves or one of its children",
2241
2235
  async function validateMoveFoldersNotInsideThemselves(value) {
2242
2236
  const { folderIds, destinationFolderId } = value;
2243
- if (destinationFolderId === null || fp.isEmpty(folderIds))
2244
- return true;
2237
+ if (destinationFolderId === null || fp.isEmpty(folderIds)) return true;
2245
2238
  const destinationFolder = await strapi.db.query(FOLDER_MODEL_UID).findOne({
2246
2239
  select: ["path"],
2247
2240
  where: { id: destinationFolderId }
@@ -2725,4 +2718,4 @@ const index = () => ({
2725
2718
  });
2726
2719
  exports.FILE_MODEL_UID = FILE_MODEL_UID;
2727
2720
  exports.index = index;
2728
- //# sourceMappingURL=index-BDq2waDf.js.map
2721
+ //# sourceMappingURL=index-D57iKFts.js.map