@steedos/service-pages 3.0.14-beta.9 → 3.0.15-beta.1

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.
@@ -10,7 +10,6 @@
10
10
  <script src="/unpkg.com/@steedos-builder/fiddle@0.0.5/dist/builder-fiddle.umd.js"></script>
11
11
  <script src="/unpkg.com/axios@0.26.1/dist/axios.min.js"></script>
12
12
  <script src="https://unpkg.steedos.cn/flowbite@2.3.0/dist/flowbite.min.js"></script>
13
- <script src="https://cdn.tailwindcss.com"></script>
14
13
  </head>
15
14
 
16
15
  <body>
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@steedos/service-pages",
3
- "version": "3.0.14-beta.9",
3
+ "version": "3.0.15-beta.1",
4
4
  "main": "package.service.js",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
7
7
  "access": "public"
8
8
  },
9
- "gitHead": "87f62a32df2ab475171cd9be1c664acd15448f85",
9
+ "gitHead": "ff62e2bc9d8c85b48d928e042f7882f0ef77cbe1",
10
10
  "dependencies": {
11
11
  "clone": "^2.1.2",
12
12
  "ejs": "^3.1.8"
@@ -112,6 +112,37 @@ module.exports = {
112
112
  return page;
113
113
  }
114
114
  },
115
+ getPageWidgetSchema: {
116
+ rest: {
117
+ method: "GET",
118
+ path: "/page/:apiName/widget_schema"
119
+ },
120
+ async handler(ctx) {
121
+ const { apiName } = ctx.params;
122
+ const widgetType = `amis-${apiName}`;
123
+
124
+ const widgets = await objectql.getObject('widgets').find({
125
+ filters: [['type', '=', widgetType]]
126
+ });
127
+
128
+ const sorted = _.sortBy(widgets, 'sort');
129
+ const bodies = sorted.map(w => w.schema).filter(Boolean);
130
+
131
+ if (bodies.length === 0) {
132
+ return { status: 0, data: { type: 'wrapper', body: [] } };
133
+ }
134
+
135
+ return {
136
+ status: 0,
137
+ data: {
138
+ type: 'wrapper',
139
+ className: 'w-full max-w-4xl space-y-4 p-0',
140
+ size: 'none',
141
+ body: bodies
142
+ }
143
+ };
144
+ }
145
+ },
115
146
  searchPage:{
116
147
  rest: {
117
148
  method: "GET",