@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.
@@ -95,7 +95,7 @@ const createHistoryVersionController = ({ strapi: strapi2 }) => {
95
95
  }
96
96
  };
97
97
  };
98
- const controllers$1 = {
98
+ const controllers$2 = {
99
99
  "history-version": createHistoryVersionController
100
100
  /**
101
101
  * Casting is needed because the types aren't aware that Strapi supports
@@ -594,17 +594,17 @@ const createLifecyclesService = ({ strapi: strapi2 }) => {
594
594
  }
595
595
  };
596
596
  };
597
- const services$1 = {
597
+ const services$2 = {
598
598
  history: createHistoryService,
599
599
  lifecycles: createLifecyclesService
600
600
  };
601
- const info = { pluginName: "content-manager", type: "admin" };
601
+ const info$1 = { pluginName: "content-manager", type: "admin" };
602
602
  const historyVersionRouter = {
603
603
  type: "admin",
604
604
  routes: [
605
605
  {
606
606
  method: "GET",
607
- info,
607
+ info: info$1,
608
608
  path: "/history-versions",
609
609
  handler: "history-version.findMany",
610
610
  config: {
@@ -613,7 +613,7 @@ const historyVersionRouter = {
613
613
  },
614
614
  {
615
615
  method: "PUT",
616
- info,
616
+ info: info$1,
617
617
  path: "/history-versions/:versionId/restore",
618
618
  handler: "history-version.restoreVersion",
619
619
  config: {
@@ -622,7 +622,7 @@ const historyVersionRouter = {
622
622
  }
623
623
  ]
624
624
  };
625
- const routes$1 = {
625
+ const routes$2 = {
626
626
  "history-version": historyVersionRouter
627
627
  };
628
628
  const historyVersion = {
@@ -681,9 +681,9 @@ const getFeature$1 = () => {
681
681
  destroy({ strapi: strapi2 }) {
682
682
  getService(strapi2, "lifecycles").destroy();
683
683
  },
684
- controllers: controllers$1,
685
- services: services$1,
686
- routes: routes$1
684
+ controllers: controllers$2,
685
+ services: services$2,
686
+ routes: routes$2
687
687
  };
688
688
  }
689
689
  return {
@@ -701,6 +701,46 @@ const ALLOWED_WEBHOOK_EVENTS = {
701
701
  ENTRY_UNPUBLISH: "entry.unpublish"
702
702
  };
703
703
  const FEATURE_ID = "preview";
704
+ const info = { pluginName: "content-manager", type: "admin" };
705
+ const previewRouter = {
706
+ type: "admin",
707
+ routes: [
708
+ {
709
+ method: "GET",
710
+ info,
711
+ path: "/preview/url/:contentType",
712
+ handler: "preview.getPreviewURL",
713
+ config: {
714
+ policies: ["admin::isAuthenticatedAdmin"]
715
+ }
716
+ }
717
+ ]
718
+ };
719
+ const routes$1 = {
720
+ preview: previewRouter
721
+ };
722
+ const createPreviewController = () => {
723
+ return {
724
+ async getPreviewURL(ctx) {
725
+ ctx.request;
726
+ return {
727
+ data: { url: "" }
728
+ };
729
+ }
730
+ };
731
+ };
732
+ const controllers$1 = {
733
+ preview: createPreviewController
734
+ /**
735
+ * Casting is needed because the types aren't aware that Strapi supports
736
+ * passing a controller factory as the value, instead of a controller object directly
737
+ */
738
+ };
739
+ const createPreviewService = () => {
740
+ };
741
+ const services$1 = {
742
+ preview: createPreviewService
743
+ };
704
744
  const getFeature = () => {
705
745
  if (!strapi.features.future.isEnabled(FEATURE_ID)) {
706
746
  return {};
@@ -708,7 +748,11 @@ const getFeature = () => {
708
748
  return {
709
749
  bootstrap() {
710
750
  console.log("Bootstrapping preview server");
711
- }
751
+ strapi.config.get("admin.preview");
752
+ },
753
+ routes: routes$1,
754
+ controllers: controllers$1,
755
+ services: services$1
712
756
  };
713
757
  };
714
758
  const preview = getFeature();
@@ -1211,7 +1255,8 @@ const admin = {
1211
1255
  };
1212
1256
  const routes = {
1213
1257
  admin,
1214
- ...history.routes ? history.routes : {}
1258
+ ...history.routes ? history.routes : {},
1259
+ ...preview.routes ? preview.routes : {}
1215
1260
  };
1216
1261
  const hasPermissionsSchema = yup$1.object({
1217
1262
  actions: yup$1.array().of(yup$1.string()),
@@ -2918,7 +2963,8 @@ const controllers = {
2918
2963
  relations,
2919
2964
  "single-types": singleTypes,
2920
2965
  uid: uid$1,
2921
- ...history.controllers ? history.controllers : {}
2966
+ ...history.controllers ? history.controllers : {},
2967
+ ...preview.controllers ? preview.controllers : {}
2922
2968
  };
2923
2969
  const keys = {
2924
2970
  CONFIGURATION: "configuration"
@@ -4448,7 +4494,8 @@ const services = {
4448
4494
  permission,
4449
4495
  "populate-builder": populateBuilder$1,
4450
4496
  uid,
4451
- ...history.services ? history.services : {}
4497
+ ...history.services ? history.services : {},
4498
+ ...preview.services ? preview.services : {}
4452
4499
  };
4453
4500
  const index = () => {
4454
4501
  return {