@steedos/standard-object-database 3.0.0-beta.94 → 3.0.0-beta.96

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steedos/standard-object-database",
3
- "version": "3.0.0-beta.94",
3
+ "version": "3.0.0-beta.96",
4
4
  "main": "package.service.js",
5
5
  "private": false,
6
6
  "publishConfig": {
@@ -11,13 +11,13 @@
11
11
  ],
12
12
  "description": "steedos package",
13
13
  "dependencies": {
14
- "@steedos/metadata-core": "3.0.0-beta.94",
15
- "@steedos/service-object-mixin": "3.0.0-beta.94",
14
+ "@steedos/metadata-core": "3.0.0-beta.96",
15
+ "@steedos/service-object-mixin": "3.0.0-beta.96",
16
16
  "amis-formula": "~6.3.0",
17
17
  "clone": "^2.1.2",
18
18
  "moleculer-bullmq": "3.0.0"
19
19
  },
20
20
  "repository": {},
21
21
  "license": "MIT",
22
- "gitHead": "d68342dfd2550f36cb8ed16af61c96720ed7bf07"
22
+ "gitHead": "96b68e266d217fce7ae35724edca75e53930db14"
23
23
  }
@@ -1,72 +0,0 @@
1
- /*
2
- * @Author: baozhoutao@steedos.com
3
- * @Date: 2022-04-04 16:34:28
4
- * @Description:
5
- */
6
- const express = require("express");
7
- const router = express.Router();
8
- const auth = require('@steedos/auth');
9
- const ejs = require('ejs');
10
- const fs = require('fs');
11
- const _ = require('lodash');
12
- const path = require('path');
13
- const getPublicAssetUrls = function(assetUrls){
14
- const values = _.map(_.split(assetUrls), (item)=>{
15
- if(_.startsWith(item, '/')){
16
- return Meteor.absoluteUrl(item) ;
17
- }else{
18
- return item;
19
- }
20
- })
21
- return _.join(values, ',')
22
- }
23
- router.get('/api/amisButtonDesign', auth.requireAuthentication, async function (req, res) {
24
- try {
25
- res.set('Content-Type', 'text/html');
26
- const userSession = req.user;
27
- let assetUrls = getPublicAssetUrls(req.query.assetUrls);
28
- const assetUrl = `assetUrl=${assetUrls.split(',').join("&assetUrl=")}&`;
29
-
30
- // const dataContext = {
31
- // rootUrl: process.env.ROOT_URL,
32
- // tenantId: userSession.spaceId,
33
- // userId: userSession.userId,
34
- // authToken: userSession.authToken
35
- // }
36
-
37
- let locale = "zh-CN";
38
- if (req.query.locale == "en-us") {
39
- locale = "en-US";
40
- } else if (req.query.locale == "zh-cn") {
41
- locale = "zh-CN";
42
- }
43
- const retUrl = process.env.ROOT_URL + `/app/admin/object_actions/view/${req.query.id}`
44
- const steedosBuilderUrl = process.env.STEEDOS_BUILDER_URL || 'https://builder.steedos.cn';
45
- const builderHost = `${steedosBuilderUrl}/amis?${assetUrl}locale=${locale}&retUrl=${retUrl}`;
46
-
47
- // let data = fs.readFileSync(__dirname+'/design.html', 'utf8');
48
- // res.send(data.replace('SteedosBuilderHost',steedosBuilderHost).replace('DataContext', JSON.stringify(dataContext)));
49
-
50
- const filename = __dirname+'/amis_button_design.ejs'
51
- const data = {
52
- builderHost,
53
- assetUrls,
54
- rootUrl: process.env.ROOT_URL,
55
- tenantId: userSession.spaceId,
56
- userId: userSession.userId,
57
- authToken: userSession.authToken,
58
- id: req.query.id,
59
- userSession: userSession
60
- }
61
- const options = {}
62
- ejs.renderFile(filename, data, options, function(err, str){
63
- // str => Rendered HTML string
64
- res.send(str);
65
- });
66
-
67
- } catch (error) {
68
- res.status(500).send({ message: error.message });
69
- }
70
-
71
- });
72
- exports.default = router;