@strapi/content-manager 0.0.0-experimental.f6c00790e260ea5a9b6b86abac5fea02b05d569c → 0.0.0-experimental.f74ae50eea1ce95176f088dba837e95b60fa2a4d

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 (80) hide show
  1. package/dist/_chunks/{ComponentConfigurationPage-CnL10QYC.mjs → ComponentConfigurationPage-7-qB29e7.mjs} +3 -3
  2. package/dist/_chunks/{ComponentConfigurationPage-CnL10QYC.mjs.map → ComponentConfigurationPage-7-qB29e7.mjs.map} +1 -1
  3. package/dist/_chunks/{ComponentConfigurationPage-G4EIirP8.js → ComponentConfigurationPage-DP7AC0UU.js} +3 -3
  4. package/dist/_chunks/{ComponentConfigurationPage-G4EIirP8.js.map → ComponentConfigurationPage-DP7AC0UU.js.map} +1 -1
  5. package/dist/_chunks/{EditConfigurationPage-I2kKh9dx.mjs → EditConfigurationPage-CI4XoymK.mjs} +3 -3
  6. package/dist/_chunks/{EditConfigurationPage-I2kKh9dx.mjs.map → EditConfigurationPage-CI4XoymK.mjs.map} +1 -1
  7. package/dist/_chunks/{EditConfigurationPage-B2AA1kVF.js → EditConfigurationPage-DITVliEI.js} +3 -3
  8. package/dist/_chunks/{EditConfigurationPage-B2AA1kVF.js.map → EditConfigurationPage-DITVliEI.js.map} +1 -1
  9. package/dist/_chunks/{EditViewPage-CHgoNwlc.js → EditViewPage-CUS2EAhB.js} +8 -4
  10. package/dist/_chunks/EditViewPage-CUS2EAhB.js.map +1 -0
  11. package/dist/_chunks/{EditViewPage-zFjJK0s8.mjs → EditViewPage-Dzpno8xI.mjs} +8 -4
  12. package/dist/_chunks/EditViewPage-Dzpno8xI.mjs.map +1 -0
  13. package/dist/_chunks/{Field-DPAzUS1M.mjs → Field-B_jG_EV9.mjs} +31 -19
  14. package/dist/_chunks/{Field-DPAzUS1M.mjs.map → Field-B_jG_EV9.mjs.map} +1 -1
  15. package/dist/_chunks/{Field-9DePZh-0.js → Field-CtUU1Fg8.js} +31 -19
  16. package/dist/_chunks/{Field-9DePZh-0.js.map → Field-CtUU1Fg8.js.map} +1 -1
  17. package/dist/_chunks/{Form-CEkENbkF.mjs → Form-BXHao2mZ.mjs} +2 -2
  18. package/dist/_chunks/{Form-CEkENbkF.mjs.map → Form-BXHao2mZ.mjs.map} +1 -1
  19. package/dist/_chunks/{Form-DPm-KZ1A.js → Form-DTqO0ymI.js} +2 -2
  20. package/dist/_chunks/{Form-DPm-KZ1A.js.map → Form-DTqO0ymI.js.map} +1 -1
  21. package/dist/_chunks/{History-utls71em.mjs → History-2Ah2CQ4T.mjs} +4 -4
  22. package/dist/_chunks/{History-utls71em.mjs.map → History-2Ah2CQ4T.mjs.map} +1 -1
  23. package/dist/_chunks/{History-DXSbTWez.js → History-C_uSGzO5.js} +4 -4
  24. package/dist/_chunks/{History-DXSbTWez.js.map → History-C_uSGzO5.js.map} +1 -1
  25. package/dist/_chunks/{ListConfigurationPage-CuMXWWqb.mjs → ListConfigurationPage-BjSJlaoC.mjs} +2 -2
  26. package/dist/_chunks/{ListConfigurationPage-CuMXWWqb.mjs.map → ListConfigurationPage-BjSJlaoC.mjs.map} +1 -1
  27. package/dist/_chunks/{ListConfigurationPage-D5C7ACZ_.js → ListConfigurationPage-nyuP7OSy.js} +2 -2
  28. package/dist/_chunks/{ListConfigurationPage-D5C7ACZ_.js.map → ListConfigurationPage-nyuP7OSy.js.map} +1 -1
  29. package/dist/_chunks/{ListViewPage-CdKd-PS_.mjs → ListViewPage-B75x3nz2.mjs} +4 -4
  30. package/dist/_chunks/{ListViewPage-CdKd-PS_.mjs.map → ListViewPage-B75x3nz2.mjs.map} +1 -1
  31. package/dist/_chunks/{ListViewPage-DfuwH1tt.js → ListViewPage-DHgHD8Xg.js} +4 -4
  32. package/dist/_chunks/{ListViewPage-DfuwH1tt.js.map → ListViewPage-DHgHD8Xg.js.map} +1 -1
  33. package/dist/_chunks/{NoContentTypePage-BIxlkWWi.js → NoContentTypePage-CDUKdZ7d.js} +2 -2
  34. package/dist/_chunks/{NoContentTypePage-BIxlkWWi.js.map → NoContentTypePage-CDUKdZ7d.js.map} +1 -1
  35. package/dist/_chunks/{NoContentTypePage-DkToTT7u.mjs → NoContentTypePage-DUacQSyF.mjs} +2 -2
  36. package/dist/_chunks/{NoContentTypePage-DkToTT7u.mjs.map → NoContentTypePage-DUacQSyF.mjs.map} +1 -1
  37. package/dist/_chunks/{NoPermissionsPage-DlWi4BAH.mjs → NoPermissionsPage-SFllMekk.mjs} +2 -2
  38. package/dist/_chunks/{NoPermissionsPage-DlWi4BAH.mjs.map → NoPermissionsPage-SFllMekk.mjs.map} +1 -1
  39. package/dist/_chunks/{NoPermissionsPage-Bu4GWYb-.js → NoPermissionsPage-zwIZydDI.js} +2 -2
  40. package/dist/_chunks/{NoPermissionsPage-Bu4GWYb-.js.map → NoPermissionsPage-zwIZydDI.js.map} +1 -1
  41. package/dist/_chunks/{Relations-QP5yn9_z.mjs → Relations-D2NRW8fC.mjs} +13 -9
  42. package/dist/_chunks/Relations-D2NRW8fC.mjs.map +1 -0
  43. package/dist/_chunks/{Relations-CFjTESWQ.js → Relations-NFLaRNPr.js} +13 -9
  44. package/dist/_chunks/Relations-NFLaRNPr.js.map +1 -0
  45. package/dist/_chunks/{en-BVzUkPxZ.js → en-BlhnxQfj.js} +2 -2
  46. package/dist/_chunks/{en-BVzUkPxZ.js.map → en-BlhnxQfj.js.map} +1 -1
  47. package/dist/_chunks/{en-CPTj6CjC.mjs → en-C8YBvRrK.mjs} +2 -2
  48. package/dist/_chunks/{en-CPTj6CjC.mjs.map → en-C8YBvRrK.mjs.map} +1 -1
  49. package/dist/_chunks/{index-BHfS6_D5.mjs → index-C9HxCo5R.mjs} +873 -820
  50. package/dist/_chunks/index-C9HxCo5R.mjs.map +1 -0
  51. package/dist/_chunks/{index-DXiHxy70.js → index-ovJRE1FM.js} +871 -818
  52. package/dist/_chunks/index-ovJRE1FM.js.map +1 -0
  53. package/dist/_chunks/{layout-DX_52HSH.mjs → layout-DaUjDiWQ.mjs} +3 -3
  54. package/dist/_chunks/{layout-DX_52HSH.mjs.map → layout-DaUjDiWQ.mjs.map} +1 -1
  55. package/dist/_chunks/{layout-bE-WUnQ0.js → layout-UNWstw_s.js} +3 -3
  56. package/dist/_chunks/{layout-bE-WUnQ0.js.map → layout-UNWstw_s.js.map} +1 -1
  57. package/dist/_chunks/{relations-SCVAL_aJ.mjs → relations-D8iFAeRu.mjs} +2 -2
  58. package/dist/_chunks/{relations-SCVAL_aJ.mjs.map → relations-D8iFAeRu.mjs.map} +1 -1
  59. package/dist/_chunks/{relations-D706vblp.js → relations-NN3coOG5.js} +2 -2
  60. package/dist/_chunks/{relations-D706vblp.js.map → relations-NN3coOG5.js.map} +1 -1
  61. package/dist/admin/index.js +2 -1
  62. package/dist/admin/index.js.map +1 -1
  63. package/dist/admin/index.mjs +3 -2
  64. package/dist/admin/src/exports.d.ts +1 -1
  65. package/dist/admin/src/hooks/useDocument.d.ts +32 -1
  66. package/dist/admin/src/pages/EditView/components/Header.d.ts +1 -0
  67. package/dist/server/index.js +13 -6
  68. package/dist/server/index.js.map +1 -1
  69. package/dist/server/index.mjs +13 -6
  70. package/dist/server/index.mjs.map +1 -1
  71. package/dist/server/src/controllers/collection-types.d.ts.map +1 -1
  72. package/dist/server/src/controllers/relations.d.ts.map +1 -1
  73. package/package.json +10 -10
  74. package/dist/_chunks/EditViewPage-CHgoNwlc.js.map +0 -1
  75. package/dist/_chunks/EditViewPage-zFjJK0s8.mjs.map +0 -1
  76. package/dist/_chunks/Relations-CFjTESWQ.js.map +0 -1
  77. package/dist/_chunks/Relations-QP5yn9_z.mjs.map +0 -1
  78. package/dist/_chunks/index-BHfS6_D5.mjs.map +0 -1
  79. package/dist/_chunks/index-DXiHxy70.js.map +0 -1
  80. package/strapi-server.js +0 -3
@@ -1898,11 +1898,17 @@ const collectionTypes = {
1898
1898
  }
1899
1899
  const isUpdate = !isCreate;
1900
1900
  if (isUpdate) {
1901
- document = await documentManager2.findOne(id, model, { populate, locale });
1902
- if (!document) {
1901
+ const documentExists = documentManager2.exists(model, id);
1902
+ if (!documentExists) {
1903
1903
  throw new errors.NotFoundError("Document not found");
1904
1904
  }
1905
- if (permissionChecker2.can.update(document)) {
1905
+ document = await documentManager2.findOne(id, model, { populate, locale });
1906
+ if (!document) {
1907
+ if (permissionChecker2.cannot.create({ locale }) || permissionChecker2.cannot.publish({ locale })) {
1908
+ throw new errors.ForbiddenError();
1909
+ }
1910
+ document = await updateDocument(ctx);
1911
+ } else if (permissionChecker2.can.update(document)) {
1906
1912
  await updateDocument(ctx);
1907
1913
  }
1908
1914
  }
@@ -2523,8 +2529,9 @@ const relations = {
2523
2529
  } else {
2524
2530
  where.id = id;
2525
2531
  }
2526
- if (status) {
2527
- where[`${alias}.published_at`] = getPublishedAtClause(status, targetUid);
2532
+ const publishedAt = getPublishedAtClause(status, targetUid);
2533
+ if (!isEmpty(publishedAt)) {
2534
+ where[`${alias}.published_at`] = publishedAt;
2528
2535
  }
2529
2536
  if (filterByLocale) {
2530
2537
  where[`${alias}.locale`] = locale;
@@ -2668,7 +2675,7 @@ const singleTypes = {
2668
2675
  permissionChecker2,
2669
2676
  model,
2670
2677
  // @ts-expect-error - fix types
2671
- { id: document.documentId, locale, publishedAt: null },
2678
+ { documentId: document.documentId, locale, publishedAt: null },
2672
2679
  { availableLocales: true, availableStatus: false }
2673
2680
  );
2674
2681
  ctx.body = { data: {}, meta };