2.5.50 • Published 1 year ago

@steedos/service-license v2.5.50

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year 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

1 year ago

3.0.0-beta.1

1 year ago

2.5.47

2 years ago

2.5.48

2 years ago

2.5.49

2 years ago

2.5.46

2 years ago

2.5.45

2 years ago

2.5.44

2 years ago

2.5.42

2 years ago

2.5.40

2 years ago

2.5.41

2 years ago

2.5.39

2 years ago

2.5.38

2 years ago

2.5.37

2 years ago

2.5.36

2 years ago

2.5.33

2 years ago

2.5.34

2 years ago

2.5.35

2 years ago

2.5.32

2 years ago

2.5.31

2 years ago

2.5.30

2 years ago

2.5.29

2 years 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

3 years ago

2.5.18

3 years ago

2.5.17

3 years ago

2.5.16

3 years ago

2.5.15

3 years ago

2.5.14

3 years ago

2.5.13

3 years ago

2.5.12

3 years ago

2.5.11

3 years ago

2.5.10

3 years ago

2.5.9

3 years ago

2.5.8

3 years ago

2.5.7

3 years ago

2.5.6

3 years ago

2.5.5

3 years ago

2.5.4

3 years ago

2.5.3

3 years ago