@steedos/service-saas 2.3.2-beta.2

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 (27) hide show
  1. package/LICENSE.txt +22 -0
  2. package/main/default/objects/datasources/buttons/standard_delete.button.js +15 -0
  3. package/main/default/objects/datasources/buttons/standard_delete_many.button.js +8 -0
  4. package/main/default/objects/datasources/buttons/standard_edit.button.js +15 -0
  5. package/main/default/objects/datasources/buttons/standard_new.button.js +15 -0
  6. package/main/default/objects/object_actions/buttons/standard_delete.button.js +15 -0
  7. package/main/default/objects/object_actions/buttons/standard_delete_many.button.js +8 -0
  8. package/main/default/objects/object_actions/buttons/standard_edit.button.js +15 -0
  9. package/main/default/objects/object_actions/buttons/standard_new.button.js +15 -0
  10. package/main/default/objects/object_fields/buttons/standard_delete.button.js +15 -0
  11. package/main/default/objects/object_fields/buttons/standard_delete_many.button.js +8 -0
  12. package/main/default/objects/object_fields/buttons/standard_edit.button.js +15 -0
  13. package/main/default/objects/object_fields/buttons/standard_new.button.js +15 -0
  14. package/main/default/objects/objects/buttons/standard_delete.button.js +15 -0
  15. package/main/default/objects/objects/buttons/standard_delete_many.button.js +8 -0
  16. package/main/default/objects/objects/buttons/standard_edit.button.js +15 -0
  17. package/main/default/objects/objects/buttons/standard_new.button.js +15 -0
  18. package/main/default/objects/steedos_packages/buttons/disable.button.js +14 -0
  19. package/main/default/objects/steedos_packages/buttons/enable.button.js +19 -0
  20. package/main/default/objects/steedos_packages/buttons/installPackageFromUrl.button.js +15 -0
  21. package/main/default/objects/steedos_packages/buttons/install_purchased_packages.button.js +15 -0
  22. package/main/default/objects/steedos_packages/buttons/reload.button.js +19 -0
  23. package/main/default/objects/steedos_packages/buttons/show_packages_store.button.js +15 -0
  24. package/main/default/objects/steedos_packages/buttons/uninstall.button.js +22 -0
  25. package/main/default/objects/steedos_packages/buttons/upgradePackage.button.js +19 -0
  26. package/package.json +16 -0
  27. package/package.service.js +75 -0
package/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Steedos Licensing
2
+
3
+ SOFTWARE LICENSING
4
+
5
+ To determine under which license you may use a file from the Steedos source code,
6
+ please resort to the header of that file.
7
+
8
+ If the file has no header, the following rules apply
9
+ 1. enterprise features are licensed under Steedos Enterprise Terms, see License.enterprise.txt
10
+ 2. source code that is neither (1) is licensed under MIT, see https://opensource.org/licenses/MIT
11
+
12
+ On request, licenses under different terms are available.
13
+
14
+ Source code of enterprise features are files that
15
+ * are in folders named "ee" or start with "ee_", or in subfolders of such folders.
16
+ * contain the strings "ee_" in its filename name.
17
+ The files can be found by running the command `find . -iname ee -or -iname "*_ee*" -or -iname "*ee_*"`
18
+
19
+ STEEDOS TRADEMARK GUIDELINES
20
+
21
+ Your use of the mark Steedos is subject to Steedos, Inc's prior written approval. For trademark approval or any questions
22
+ you have about using these trademarks, please email zhuangjianguo@steedos.com
@@ -0,0 +1,15 @@
1
+ /*
2
+ * @Author: baozhoutao@steedos.com
3
+ * @Date: 2022-11-15 11:16:57
4
+ * @LastEditors: baozhoutao@steedos.com
5
+ * @LastEditTime: 2022-11-15 14:04:49
6
+ * @Description:
7
+ */
8
+ module.exports = {
9
+ standard_deleteVisible: function () {
10
+ if(Meteor.settings.public.enable_saas){
11
+ return Creator.USER_CONTEXT.user.spaceId === Creator.USER_CONTEXT.user.masterSpaceId && Steedos.StandardObjects.Base.Actions.standard_delete.visible.apply(this, arguments)
12
+ }
13
+ return Steedos.StandardObjects.Base.Actions.standard_delete.visible.apply(this, arguments)
14
+ }
15
+ }
@@ -0,0 +1,8 @@
1
+ module.exports = {
2
+ standard_delete_manyVisible: function () {
3
+ if(Meteor.settings.public.enable_saas){
4
+ return Creator.USER_CONTEXT.user.spaceId === Creator.USER_CONTEXT.user.masterSpaceId && Steedos.StandardObjects.Base.Actions.standard_delete_many.visible.apply(this, arguments)
5
+ }
6
+ return Steedos.StandardObjects.Base.Actions.standard_delete_many.visible.apply(this, arguments)
7
+ }
8
+ }
@@ -0,0 +1,15 @@
1
+ /*
2
+ * @Author: baozhoutao@steedos.com
3
+ * @Date: 2022-11-15 11:17:33
4
+ * @LastEditors: baozhoutao@steedos.com
5
+ * @LastEditTime: 2022-11-15 11:43:12
6
+ * @Description:
7
+ */
8
+ module.exports = {
9
+ standard_editVisible: function () {
10
+ if(Meteor.settings.public.enable_saas){
11
+ return Creator.USER_CONTEXT.user.spaceId === Creator.USER_CONTEXT.user.masterSpaceId && Steedos.StandardObjects.Base.Actions.standard_edit.visible.apply(this, arguments)
12
+ }
13
+ return Steedos.StandardObjects.Base.Actions.standard_edit.visible.apply(this, arguments)
14
+ }
15
+ }
@@ -0,0 +1,15 @@
1
+ /*
2
+ * @Author: baozhoutao@steedos.com
3
+ * @Date: 2022-11-15 11:16:57
4
+ * @LastEditors: baozhoutao@steedos.com
5
+ * @LastEditTime: 2022-11-15 11:43:25
6
+ * @Description:
7
+ */
8
+ module.exports = {
9
+ standard_newVisible: function () {
10
+ if(Meteor.settings.public.enable_saas){
11
+ return Creator.USER_CONTEXT.user.spaceId === Creator.USER_CONTEXT.user.masterSpaceId && Steedos.StandardObjects.Base.Actions.standard_new.visible.apply(this, arguments)
12
+ }
13
+ return Steedos.StandardObjects.Base.Actions.standard_new.visible.apply(this, arguments)
14
+ }
15
+ }
@@ -0,0 +1,15 @@
1
+ /*
2
+ * @Author: baozhoutao@steedos.com
3
+ * @Date: 2022-11-15 11:16:57
4
+ * @LastEditors: baozhoutao@steedos.com
5
+ * @LastEditTime: 2022-11-15 11:42:50
6
+ * @Description:
7
+ */
8
+ module.exports = {
9
+ standard_deleteVisible: function () {
10
+ if(Meteor.settings.public.enable_saas){
11
+ return Creator.USER_CONTEXT.user.spaceId === Creator.USER_CONTEXT.user.masterSpaceId && Steedos.StandardObjects.Base.Actions.standard_delete.visible.apply(this, arguments)
12
+ }
13
+ return Steedos.StandardObjects.Base.Actions.standard_delete.visible.apply(this, arguments)
14
+ }
15
+ }
@@ -0,0 +1,8 @@
1
+ module.exports = {
2
+ standard_delete_manyVisible: function () {
3
+ if(Meteor.settings.public.enable_saas){
4
+ return Creator.USER_CONTEXT.user.spaceId === Creator.USER_CONTEXT.user.masterSpaceId && Steedos.StandardObjects.Base.Actions.standard_delete_many.visible.apply(this, arguments)
5
+ }
6
+ return Steedos.StandardObjects.Base.Actions.standard_delete_many.visible.apply(this, arguments)
7
+ }
8
+ }
@@ -0,0 +1,15 @@
1
+ /*
2
+ * @Author: baozhoutao@steedos.com
3
+ * @Date: 2022-11-15 11:17:33
4
+ * @LastEditors: baozhoutao@steedos.com
5
+ * @LastEditTime: 2022-11-15 11:43:12
6
+ * @Description:
7
+ */
8
+ module.exports = {
9
+ standard_editVisible: function () {
10
+ if(Meteor.settings.public.enable_saas){
11
+ return Creator.USER_CONTEXT.user.spaceId === Creator.USER_CONTEXT.user.masterSpaceId && Steedos.StandardObjects.Base.Actions.standard_edit.visible.apply(this, arguments)
12
+ }
13
+ return Steedos.StandardObjects.Base.Actions.standard_edit.visible.apply(this, arguments)
14
+ }
15
+ }
@@ -0,0 +1,15 @@
1
+ /*
2
+ * @Author: baozhoutao@steedos.com
3
+ * @Date: 2022-11-15 11:16:57
4
+ * @LastEditors: baozhoutao@steedos.com
5
+ * @LastEditTime: 2022-11-15 11:43:25
6
+ * @Description:
7
+ */
8
+ module.exports = {
9
+ standard_newVisible: function () {
10
+ if(Meteor.settings.public.enable_saas){
11
+ return Creator.USER_CONTEXT.user.spaceId === Creator.USER_CONTEXT.user.masterSpaceId && Steedos.StandardObjects.Base.Actions.standard_new.visible.apply(this, arguments)
12
+ }
13
+ return Steedos.StandardObjects.Base.Actions.standard_new.visible.apply(this, arguments)
14
+ }
15
+ }
@@ -0,0 +1,15 @@
1
+ /*
2
+ * @Author: baozhoutao@steedos.com
3
+ * @Date: 2022-11-15 11:16:57
4
+ * @LastEditors: baozhoutao@steedos.com
5
+ * @LastEditTime: 2022-11-15 11:42:50
6
+ * @Description:
7
+ */
8
+ module.exports = {
9
+ standard_deleteVisible: function () {
10
+ if(Meteor.settings.public.enable_saas){
11
+ return Creator.USER_CONTEXT.user.spaceId === Creator.USER_CONTEXT.user.masterSpaceId && Steedos.StandardObjects.Base.Actions.standard_delete.visible.apply(this, arguments)
12
+ }
13
+ return Steedos.StandardObjects.Base.Actions.standard_delete.visible.apply(this, arguments)
14
+ }
15
+ }
@@ -0,0 +1,8 @@
1
+ module.exports = {
2
+ standard_delete_manyVisible: function () {
3
+ if(Meteor.settings.public.enable_saas){
4
+ return Creator.USER_CONTEXT.user.spaceId === Creator.USER_CONTEXT.user.masterSpaceId && Steedos.StandardObjects.Base.Actions.standard_delete_many.visible.apply(this, arguments)
5
+ }
6
+ return Steedos.StandardObjects.Base.Actions.standard_delete_many.visible.apply(this, arguments)
7
+ }
8
+ }
@@ -0,0 +1,15 @@
1
+ /*
2
+ * @Author: baozhoutao@steedos.com
3
+ * @Date: 2022-11-15 11:17:33
4
+ * @LastEditors: baozhoutao@steedos.com
5
+ * @LastEditTime: 2022-11-15 11:43:12
6
+ * @Description:
7
+ */
8
+ module.exports = {
9
+ standard_editVisible: function () {
10
+ if(Meteor.settings.public.enable_saas){
11
+ return Creator.USER_CONTEXT.user.spaceId === Creator.USER_CONTEXT.user.masterSpaceId && Steedos.StandardObjects.Base.Actions.standard_edit.visible.apply(this, arguments)
12
+ }
13
+ return Steedos.StandardObjects.Base.Actions.standard_edit.visible.apply(this, arguments)
14
+ }
15
+ }
@@ -0,0 +1,15 @@
1
+ /*
2
+ * @Author: baozhoutao@steedos.com
3
+ * @Date: 2022-11-15 11:16:57
4
+ * @LastEditors: baozhoutao@steedos.com
5
+ * @LastEditTime: 2022-11-15 11:43:25
6
+ * @Description:
7
+ */
8
+ module.exports = {
9
+ standard_newVisible: function () {
10
+ if(Meteor.settings.public.enable_saas){
11
+ return Creator.USER_CONTEXT.user.spaceId === Creator.USER_CONTEXT.user.masterSpaceId && Steedos.StandardObjects.Base.Actions.standard_new.visible.apply(this, arguments)
12
+ }
13
+ return Steedos.StandardObjects.Base.Actions.standard_new.visible.apply(this, arguments)
14
+ }
15
+ }
@@ -0,0 +1,15 @@
1
+ /*
2
+ * @Author: baozhoutao@steedos.com
3
+ * @Date: 2022-11-15 11:16:57
4
+ * @LastEditors: baozhoutao@steedos.com
5
+ * @LastEditTime: 2022-11-15 11:42:50
6
+ * @Description:
7
+ */
8
+ module.exports = {
9
+ standard_deleteVisible: function () {
10
+ if(Meteor.settings.public.enable_saas){
11
+ return Creator.USER_CONTEXT.user.spaceId === Creator.USER_CONTEXT.user.masterSpaceId && Steedos.StandardObjects.Base.Actions.standard_delete.visible.apply(this, arguments)
12
+ }
13
+ return Steedos.StandardObjects.Base.Actions.standard_delete.visible.apply(this, arguments)
14
+ }
15
+ }
@@ -0,0 +1,8 @@
1
+ module.exports = {
2
+ standard_delete_manyVisible: function () {
3
+ if(Meteor.settings.public.enable_saas){
4
+ return Creator.USER_CONTEXT.user.spaceId === Creator.USER_CONTEXT.user.masterSpaceId && Steedos.StandardObjects.Base.Actions.standard_delete_many.visible.apply(this, arguments)
5
+ }
6
+ return Steedos.StandardObjects.Base.Actions.standard_delete_many.visible.apply(this, arguments)
7
+ }
8
+ }
@@ -0,0 +1,15 @@
1
+ /*
2
+ * @Author: baozhoutao@steedos.com
3
+ * @Date: 2022-11-15 11:17:33
4
+ * @LastEditors: baozhoutao@steedos.com
5
+ * @LastEditTime: 2022-11-15 11:43:12
6
+ * @Description:
7
+ */
8
+ module.exports = {
9
+ standard_editVisible: function () {
10
+ if(Meteor.settings.public.enable_saas){
11
+ return Creator.USER_CONTEXT.user.spaceId === Creator.USER_CONTEXT.user.masterSpaceId && Steedos.StandardObjects.Base.Actions.standard_edit.visible.apply(this, arguments)
12
+ }
13
+ return Steedos.StandardObjects.Base.Actions.standard_edit.visible.apply(this, arguments)
14
+ }
15
+ }
@@ -0,0 +1,15 @@
1
+ /*
2
+ * @Author: baozhoutao@steedos.com
3
+ * @Date: 2022-11-15 11:16:57
4
+ * @LastEditors: baozhoutao@steedos.com
5
+ * @LastEditTime: 2022-11-15 11:43:25
6
+ * @Description:
7
+ */
8
+ module.exports = {
9
+ standard_newVisible: function () {
10
+ if(Meteor.settings.public.enable_saas){
11
+ return Creator.USER_CONTEXT.user.spaceId === Creator.USER_CONTEXT.user.masterSpaceId && Steedos.StandardObjects.Base.Actions.standard_new.visible.apply(this, arguments)
12
+ }
13
+ return Steedos.StandardObjects.Base.Actions.standard_new.visible.apply(this, arguments)
14
+ }
15
+ }
@@ -0,0 +1,14 @@
1
+ module.exports = {
2
+ disableVisible: function (object_name, record_id) {
3
+
4
+ if(Meteor.settings.public.enable_saas && Creator.USER_CONTEXT.user.spaceId != Creator.USER_CONTEXT.user.masterSpaceId){
5
+ return false
6
+ }
7
+
8
+ const record = Creator.odata.get(object_name, record_id);
9
+ if (record.status === 'enable') {
10
+ return true;
11
+ }
12
+ return false
13
+ }
14
+ }
@@ -0,0 +1,19 @@
1
+ /*
2
+ * @Author: baozhoutao@steedos.com
3
+ * @Date: 2022-11-15 13:35:27
4
+ * @LastEditors: baozhoutao@steedos.com
5
+ * @LastEditTime: 2022-11-15 13:37:53
6
+ * @Description:
7
+ */
8
+ module.exports = {
9
+ enableVisible: function (object_name,record_id) {
10
+ if(Meteor.settings.public.enable_saas && Creator.USER_CONTEXT.user.spaceId != Creator.USER_CONTEXT.user.masterSpaceId){
11
+ return false
12
+ }
13
+ const record = Creator.odata.get(object_name,record_id);
14
+ if(record.status !== 'enable'){
15
+ return true;
16
+ }
17
+ return false
18
+ }
19
+ }
@@ -0,0 +1,15 @@
1
+ /*
2
+ * @Author: baozhoutao@steedos.com
3
+ * @Date: 2022-11-15 13:35:27
4
+ * @LastEditors: baozhoutao@steedos.com
5
+ * @LastEditTime: 2022-11-15 13:37:59
6
+ * @Description:
7
+ */
8
+ module.exports = {
9
+ installPackageFromUrlVisible: function (object_name, record_id) {
10
+ if(Meteor.settings.public.enable_saas && Creator.USER_CONTEXT.user.spaceId != Creator.USER_CONTEXT.user.masterSpaceId){
11
+ return false
12
+ }
13
+ return Steedos.isSpaceAdmin();
14
+ }
15
+ }
@@ -0,0 +1,15 @@
1
+ /*
2
+ * @Author: baozhoutao@steedos.com
3
+ * @Date: 2022-11-15 13:35:27
4
+ * @LastEditors: baozhoutao@steedos.com
5
+ * @LastEditTime: 2022-11-15 13:37:56
6
+ * @Description:
7
+ */
8
+ module.exports = {
9
+ install_purchased_packagesVisible: function (object_name, record_id) {
10
+ if(Meteor.settings.public.enable_saas && Creator.USER_CONTEXT.user.spaceId != Creator.USER_CONTEXT.user.masterSpaceId){
11
+ return false
12
+ }
13
+ return true;
14
+ }
15
+ }
@@ -0,0 +1,19 @@
1
+ /*
2
+ * @Author: baozhoutao@steedos.com
3
+ * @Date: 2022-11-15 13:35:27
4
+ * @LastEditors: baozhoutao@steedos.com
5
+ * @LastEditTime: 2022-11-15 13:38:02
6
+ * @Description:
7
+ */
8
+ module.exports = {
9
+ reloadVisible: function (object_name,record_id) {
10
+ if(Meteor.settings.public.enable_saas && Creator.USER_CONTEXT.user.spaceId != Creator.USER_CONTEXT.user.masterSpaceId){
11
+ return false
12
+ }
13
+ const record = Creator.odata.get(object_name,record_id);
14
+ if(record.status === 'enable'){
15
+ return true;
16
+ }
17
+ return false
18
+ }
19
+ }
@@ -0,0 +1,15 @@
1
+ /*
2
+ * @Author: baozhoutao@steedos.com
3
+ * @Date: 2022-11-15 13:35:27
4
+ * @LastEditors: baozhoutao@steedos.com
5
+ * @LastEditTime: 2022-11-15 13:38:04
6
+ * @Description:
7
+ */
8
+ module.exports = {
9
+ show_packages_storeVisible: function () {
10
+ if(Meteor.settings.public.enable_saas && Creator.USER_CONTEXT.user.spaceId != Creator.USER_CONTEXT.user.masterSpaceId){
11
+ return false
12
+ }
13
+ return true
14
+ }
15
+ }
@@ -0,0 +1,22 @@
1
+ /*
2
+ * @Author: baozhoutao@steedos.com
3
+ * @Date: 2022-11-15 13:35:27
4
+ * @LastEditors: baozhoutao@steedos.com
5
+ * @LastEditTime: 2022-11-15 13:38:07
6
+ * @Description:
7
+ */
8
+ module.exports = {
9
+ uninstallVisible: function (object_name,record_id) {
10
+ if(Meteor.settings.public.enable_saas && Creator.USER_CONTEXT.user.spaceId != Creator.USER_CONTEXT.user.masterSpaceId){
11
+ return false
12
+ }
13
+ const record = Creator.odata.get(object_name,record_id);
14
+ if(record.local){
15
+ return false;
16
+ }
17
+ if(record.status){
18
+ return true;
19
+ }
20
+ return false
21
+ }
22
+ }
@@ -0,0 +1,19 @@
1
+ /*
2
+ * @Author: baozhoutao@steedos.com
3
+ * @Date: 2022-11-15 13:35:27
4
+ * @LastEditors: baozhoutao@steedos.com
5
+ * @LastEditTime: 2022-11-15 13:38:10
6
+ * @Description:
7
+ */
8
+ module.exports = {
9
+ upgradePackageVisible: function (object_name, record_id) {
10
+ if(Meteor.settings.public.enable_saas && Creator.USER_CONTEXT.user.spaceId != Creator.USER_CONTEXT.user.masterSpaceId){
11
+ return false
12
+ }
13
+ const record = Creator.odata.get(object_name, record_id);
14
+ if (record.status === 'enable' && !record.local) {
15
+ return true;
16
+ }
17
+ return false
18
+ }
19
+ }
package/package.json ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "@steedos/service-saas",
3
+ "version": "2.3.2-beta.2",
4
+ "main": "package.service.js",
5
+ "private": false,
6
+ "publishConfig": {
7
+ "access": "public"
8
+ },
9
+ "keywords": [
10
+ "steedos"
11
+ ],
12
+ "description": "steedos package",
13
+ "repository": {},
14
+ "license": "MIT",
15
+ "gitHead": "2e469778c682ec784fbfb93f5e83d2f5f9671ea5"
16
+ }
@@ -0,0 +1,75 @@
1
+ /*
2
+ * @Author: sunhaolin@hotoa.com
3
+ * @Date: 1985-10-26 16:15:00
4
+ * @LastEditors: baozhoutao@steedos.com
5
+ * @LastEditTime: 2022-11-15 11:12:21
6
+ * @Description:
7
+ */
8
+ "use strict";
9
+ const project = require('./package.json');
10
+ const packageName = project.name;
11
+ const packageLoader = require('@steedos/service-package-loader');
12
+ /**
13
+ * @typedef {import('moleculer').Context} Context Moleculer's Context
14
+ */
15
+ module.exports = {
16
+ name: packageName,
17
+ namespace: "steedos",
18
+ mixins: [packageLoader],
19
+ /**
20
+ * Settings
21
+ */
22
+ settings: {
23
+ packageInfo: {
24
+ path: __dirname,
25
+ name: packageName
26
+ }
27
+ },
28
+
29
+ /**
30
+ * Dependencies
31
+ */
32
+ dependencies: [],
33
+
34
+ /**
35
+ * Actions
36
+ */
37
+ actions: {
38
+
39
+ },
40
+
41
+ /**
42
+ * Events
43
+ */
44
+ events: {
45
+
46
+ },
47
+
48
+ /**
49
+ * Methods
50
+ */
51
+ methods: {
52
+
53
+ },
54
+
55
+ /**
56
+ * Service created lifecycle event handler
57
+ */
58
+ async created() {
59
+
60
+ },
61
+
62
+ /**
63
+ * Service started lifecycle event handler
64
+ */
65
+ async started() {
66
+
67
+ },
68
+
69
+ /**
70
+ * Service stopped lifecycle event handler
71
+ */
72
+ async stopped() {
73
+
74
+ }
75
+ };