corebasic 1.0.127 → 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/elabase.js +9 -5
- package/libs/features.js +6 -0
- package/package.json +1 -1
package/libs/elabase.js
CHANGED
|
@@ -123,11 +123,15 @@ export const insert = async (meta, collection, value, _id) => {
|
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
export const query = async (meta, collection, query, options) => {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
126
|
+
if (meta?.USE_EMPTY_COMPANY) {
|
|
127
|
+
|
|
128
|
+
} else {
|
|
129
|
+
// Multi Company Support
|
|
130
|
+
if (Utils.isEmpty(meta?.company)) throw {message: "Error: meta argument not provided in Dip.query()"}
|
|
131
|
+
collection = `${meta.company}.${collection}`
|
|
132
|
+
if (meta.company !== "GLOBAL")
|
|
133
|
+
query.company = meta.company
|
|
134
|
+
}
|
|
131
135
|
// ---------------------
|
|
132
136
|
|
|
133
137
|
|
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()
|