@strapi/content-manager 0.0.0-next.7f1333f1967e625c57ab16648c057aea08c9dddb → 0.0.0-next.b558642be856459a3e6c076f5d76fffbfc5fc5a1

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.
@@ -121,7 +121,7 @@ const createHistoryVersionController = ({ strapi: strapi2 }) => {
121
121
  }
122
122
  };
123
123
  };
124
- const controllers$1 = {
124
+ const controllers$2 = {
125
125
  "history-version": createHistoryVersionController
126
126
  /**
127
127
  * Casting is needed because the types aren't aware that Strapi supports
@@ -620,17 +620,17 @@ const createLifecyclesService = ({ strapi: strapi2 }) => {
620
620
  }
621
621
  };
622
622
  };
623
- const services$1 = {
623
+ const services$2 = {
624
624
  history: createHistoryService,
625
625
  lifecycles: createLifecyclesService
626
626
  };
627
- const info = { pluginName: "content-manager", type: "admin" };
627
+ const info$1 = { pluginName: "content-manager", type: "admin" };
628
628
  const historyVersionRouter = {
629
629
  type: "admin",
630
630
  routes: [
631
631
  {
632
632
  method: "GET",
633
- info,
633
+ info: info$1,
634
634
  path: "/history-versions",
635
635
  handler: "history-version.findMany",
636
636
  config: {
@@ -639,7 +639,7 @@ const historyVersionRouter = {
639
639
  },
640
640
  {
641
641
  method: "PUT",
642
- info,
642
+ info: info$1,
643
643
  path: "/history-versions/:versionId/restore",
644
644
  handler: "history-version.restoreVersion",
645
645
  config: {
@@ -648,7 +648,7 @@ const historyVersionRouter = {
648
648
  }
649
649
  ]
650
650
  };
651
- const routes$1 = {
651
+ const routes$2 = {
652
652
  "history-version": historyVersionRouter
653
653
  };
654
654
  const historyVersion = {
@@ -707,9 +707,9 @@ const getFeature$1 = () => {
707
707
  destroy({ strapi: strapi2 }) {
708
708
  getService(strapi2, "lifecycles").destroy();
709
709
  },
710
- controllers: controllers$1,
711
- services: services$1,
712
- routes: routes$1
710
+ controllers: controllers$2,
711
+ services: services$2,
712
+ routes: routes$2
713
713
  };
714
714
  }
715
715
  return {
@@ -727,6 +727,46 @@ const ALLOWED_WEBHOOK_EVENTS = {
727
727
  ENTRY_UNPUBLISH: "entry.unpublish"
728
728
  };
729
729
  const FEATURE_ID = "preview";
730
+ const info = { pluginName: "content-manager", type: "admin" };
731
+ const previewRouter = {
732
+ type: "admin",
733
+ routes: [
734
+ {
735
+ method: "GET",
736
+ info,
737
+ path: "/preview/url/:contentType",
738
+ handler: "preview.getPreviewURL",
739
+ config: {
740
+ policies: ["admin::isAuthenticatedAdmin"]
741
+ }
742
+ }
743
+ ]
744
+ };
745
+ const routes$1 = {
746
+ preview: previewRouter
747
+ };
748
+ const createPreviewController = () => {
749
+ return {
750
+ async getPreviewURL(ctx) {
751
+ ctx.request;
752
+ return {
753
+ data: { url: "" }
754
+ };
755
+ }
756
+ };
757
+ };
758
+ const controllers$1 = {
759
+ preview: createPreviewController
760
+ /**
761
+ * Casting is needed because the types aren't aware that Strapi supports
762
+ * passing a controller factory as the value, instead of a controller object directly
763
+ */
764
+ };
765
+ const createPreviewService = () => {
766
+ };
767
+ const services$1 = {
768
+ preview: createPreviewService
769
+ };
730
770
  const getFeature = () => {
731
771
  if (!strapi.features.future.isEnabled(FEATURE_ID)) {
732
772
  return {};
@@ -734,7 +774,11 @@ const getFeature = () => {
734
774
  return {
735
775
  bootstrap() {
736
776
  console.log("Bootstrapping preview server");
737
- }
777
+ strapi.config.get("admin.preview");
778
+ },
779
+ routes: routes$1,
780
+ controllers: controllers$1,
781
+ services: services$1
738
782
  };
739
783
  };
740
784
  const preview = getFeature();
@@ -1237,7 +1281,8 @@ const admin = {
1237
1281
  };
1238
1282
  const routes = {
1239
1283
  admin,
1240
- ...history.routes ? history.routes : {}
1284
+ ...history.routes ? history.routes : {},
1285
+ ...preview.routes ? preview.routes : {}
1241
1286
  };
1242
1287
  const hasPermissionsSchema = strapiUtils.yup.object({
1243
1288
  actions: strapiUtils.yup.array().of(strapiUtils.yup.string()),
@@ -2944,7 +2989,8 @@ const controllers = {
2944
2989
  relations,
2945
2990
  "single-types": singleTypes,
2946
2991
  uid: uid$1,
2947
- ...history.controllers ? history.controllers : {}
2992
+ ...history.controllers ? history.controllers : {},
2993
+ ...preview.controllers ? preview.controllers : {}
2948
2994
  };
2949
2995
  const keys = {
2950
2996
  CONFIGURATION: "configuration"
@@ -4474,7 +4520,8 @@ const services = {
4474
4520
  permission,
4475
4521
  "populate-builder": populateBuilder$1,
4476
4522
  uid,
4477
- ...history.services ? history.services : {}
4523
+ ...history.services ? history.services : {},
4524
+ ...preview.services ? preview.services : {}
4478
4525
  };
4479
4526
  const index = () => {
4480
4527
  return {