corebasic 1.0.257 → 1.0.258
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/dist/libs/features.js +2 -2
- package/libs/features.ts +2 -2
- package/package.json +1 -1
package/dist/libs/features.js
CHANGED
|
@@ -96,7 +96,7 @@ export const send = async (meta, feature, data, params) => {
|
|
|
96
96
|
if (url.includes(':'))
|
|
97
97
|
throw new Error(`Error: Internal feature call send on feature: ${feature} when api/params/substitution`);
|
|
98
98
|
}
|
|
99
|
-
const payload = { ...meta, data, feature, txn: Utils.uid() };
|
|
99
|
+
const payload = { ...meta, data, feature, txn: Utils.uid(), params: params ?? {} };
|
|
100
100
|
service = service.replace('http://slyp.app', 'https://slyp.app');
|
|
101
101
|
// return (await axios[method](`${service}${url}`, { data: payload, headers: {jwt: headers.jwt}, timeout: 1000 })).data
|
|
102
102
|
// Used to work. But request to 127.0.0.1 fails to send the specified headers along with the request.
|
|
@@ -185,7 +185,7 @@ const apiHandler = async (req, res) => {
|
|
|
185
185
|
const message = {
|
|
186
186
|
meta,
|
|
187
187
|
data: req.body.data,
|
|
188
|
-
params: req.params,
|
|
188
|
+
params: featureless ? req.params : req.body.params,
|
|
189
189
|
};
|
|
190
190
|
const appReq = {
|
|
191
191
|
meta: message.meta,
|
package/libs/features.ts
CHANGED
|
@@ -208,7 +208,7 @@ export const send = async <K extends keyof FeatureTypes> (meta: Partial<FeatureM
|
|
|
208
208
|
throw new Error(`Error: Internal feature call send on feature: ${feature} when api/params/substitution`)
|
|
209
209
|
}
|
|
210
210
|
|
|
211
|
-
const payload: PayloadMessage = { ...meta, data, feature, txn: Utils.uid() } as PayloadMessage
|
|
211
|
+
const payload: PayloadMessage = { ...meta, data, feature, txn: Utils.uid(), params: params ?? {} } as PayloadMessage
|
|
212
212
|
service = service.replace('http://slyp.app', 'https://slyp.app')
|
|
213
213
|
|
|
214
214
|
// return (await axios[method](`${service}${url}`, { data: payload, headers: {jwt: headers.jwt}, timeout: 1000 })).data
|
|
@@ -312,7 +312,7 @@ const apiHandler = async (req: ExpressRequest, res: ExpressResponse) => {
|
|
|
312
312
|
const message: FeatureMessage = {
|
|
313
313
|
meta,
|
|
314
314
|
data: req.body.data,
|
|
315
|
-
params: req.params
|
|
315
|
+
params: featureless ? req.params : req.body.params!,
|
|
316
316
|
}
|
|
317
317
|
|
|
318
318
|
const appReq: Req = {
|