2.5.50 • Published 2 months ago

@steedos/service-license v2.5.50

Weekly downloads
-
License
ISC
Repository
-
Last release
2 months ago

功能说明

  • 提供软件包许可证校验

actions

  • hasProduct(packageName, spaceId): 是否有软件包的许可证
  • getProduct(packageName, spaceId): 获取软件包的许可证详细信息

  • hasFeature(packageFeatureName, spaceId): 许可证中是否有指定的功能点

  • getFeature(packageFeatureName, spaceId): 获取许可证中功能点详细信息

示例: xxx.trigger.js

{
    listenTo: 'contracts',
    beforeInsert: async function () {
        const allow = await objectql.getSteedosSchema().broker.call(`@steedos/service-license.hasProduct`, { key: '@steedos-labs/contract', spaceId: this.spaceId })
        if (!allow) {
            throw new Error(`请购买许可证`);
        }
    },
    beforeUpdate: async function () {
        if(this.doc.payment){
            const allow = await objectql.getSteedosSchema().broker.call(`@steedos/service-license.hasFeature`, { key: '@steedos-labs/contract#payment', spaceId: this.spaceId })
            if (!allow) {
                throw new Error(`创建付款合同失败,请购买升级许可证`);
            }
        }
        
    }
}

client js 中判断软件包许可证及软件包功能点:

  • Steedos.hasProduct(packageName): 是否有软件包的许可证
  • Steedos.getProduct(packageName): 获取软件包的许可证详细信息

  • Steedos.hasFeature(packageFeatureName): 许可证中是否有指定的功能点

  • Steedos.getFeature(packageFeatureName): 获取许可证中功能点详细信息
2.5.50

3 months ago

3.0.0-beta.1

2 months ago

2.5.47

1 year ago

2.5.48

1 year ago

2.5.49

1 year ago

2.5.46

1 year ago

2.5.45

1 year ago

2.5.44

1 year ago

2.5.42

1 year ago

2.5.40

1 year ago

2.5.41

1 year ago

2.5.39

1 year ago

2.5.38

1 year ago

2.5.37

1 year ago

2.5.36

1 year ago

2.5.33

1 year ago

2.5.34

1 year ago

2.5.35

1 year ago

2.5.32

1 year ago

2.5.31

1 year ago

2.5.30

1 year ago

2.5.29

1 year ago

2.5.28

2 years ago

2.5.25

2 years ago

2.5.26

2 years ago

2.5.27

2 years ago

2.5.24

2 years ago

2.5.23

2 years ago

2.5.21

2 years ago

2.5.20

2 years ago

2.5.19

2 years ago

2.5.18

2 years ago

2.5.17

2 years ago

2.5.16

2 years ago

2.5.15

2 years ago

2.5.14

2 years ago

2.5.13

2 years ago

2.5.12

2 years ago

2.5.11

2 years ago

2.5.10

2 years ago

2.5.9

2 years ago

2.5.8

2 years ago

2.5.7

2 years ago

2.5.6

2 years ago

2.5.5

2 years ago

2.5.4

2 years ago

2.5.3

2 years ago