corebasic 1.0.85 → 1.0.86

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.
Files changed (2) hide show
  1. package/libs/features.js +5 -3
  2. package/package.json +1 -1
package/libs/features.js CHANGED
@@ -12,7 +12,7 @@ const getFeatureMethod = api => api.split(' ')[0].toLowerCase()
12
12
  const getFeatureUrl = api => api.split(' ')[1]
13
13
  const getFeature = name => features[name]
14
14
 
15
- export const send = async (feature, params, payload) => {
15
+ export const send = async (feature, params, payload, headers) => {
16
16
  let {api} = getFeature(feature)
17
17
  let method = getFeatureMethod(api)
18
18
  let url = getFeatureUrl(api)
@@ -24,7 +24,9 @@ export const send = async (feature, params, payload) => {
24
24
  throw {feature, when: 'api/params/substitution', message: "Internal Feature Call" }
25
25
  }
26
26
 
27
- return await (axios[method](`http://127.0.0.1${url}`,payload).timeout(1000))
27
+ payload = { ...payload, feature, txn: Utils.uid() }
28
+
29
+ return (await axios[method](`http://127.0.0.1:3000${url}`, { data: payload, headers: {jwt: headers.jwt}, timeout: 1000 })).data
28
30
  }
29
31
 
30
32
 
@@ -61,7 +63,7 @@ export const start = async (app, url, file) => {
61
63
  try {
62
64
  if (method === "get") {
63
65
  try {
64
- await feature.handler({...req, body: {...req.body, topic} }, res)
66
+ await feature.handler({...req, headers: req.headers, body: {...req.body, topic} }, res)
65
67
  } catch (err) {
66
68
  throw {status: 500, message: "Failed to GET feature", ...err}
67
69
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "corebasic",
3
3
  "type": "module",
4
- "version": "1.0.85",
4
+ "version": "1.0.86",
5
5
  "description": "",
6
6
  "main": "index.js",
7
7
  "scripts": {