corebasic 1.0.128 → 1.0.129
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/libs/features.js +6 -0
- package/package.json +1 -1
package/libs/features.js
CHANGED
|
@@ -39,6 +39,12 @@ let appId = Utils.uid()
|
|
|
39
39
|
let SERVICE_ADDRESS = process.env.APP_ENDPOINT || 'http://127.0.0.1:3000'
|
|
40
40
|
|
|
41
41
|
|
|
42
|
+
export const get = feature => {
|
|
43
|
+
const throwError = () => {throw {message: `Feature ${feature} not found in internal or external list during Features.subscribe call`}}
|
|
44
|
+
let {api, service = SERVICE_ADDRESS, topic} = getFeature(feature) ?? SLYP_FEATURES_LIST[feature] ?? throwError()
|
|
45
|
+
return {api, service, topic}
|
|
46
|
+
}
|
|
47
|
+
|
|
42
48
|
export const send = async (meta, feature, data, params) => {
|
|
43
49
|
const throwError = () => {throw {message: `Feature ${feature} not found in internal or external list during inter feature call`}}
|
|
44
50
|
let {api, service = SERVICE_ADDRESS} = getFeature(feature) ?? SLYP_FEATURES_LIST[feature] ?? throwError()
|