corebasic 1.0.258 → 1.0.259
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
|
@@ -92,7 +92,7 @@ export const send = async (meta, feature, data, params) => {
|
|
|
92
92
|
let url = getFeatureUrl(api);
|
|
93
93
|
if (params || url.includes(':')) {
|
|
94
94
|
for (let key in params)
|
|
95
|
-
url = url.replace(`:${key}`, params[key]);
|
|
95
|
+
url = url.replace(`:${key}`, encodeURIComponent(params[key]));
|
|
96
96
|
if (url.includes(':'))
|
|
97
97
|
throw new Error(`Error: Internal feature call send on feature: ${feature} when api/params/substitution`);
|
|
98
98
|
}
|
|
@@ -103,7 +103,7 @@ export const send = async (meta, feature, data, params) => {
|
|
|
103
103
|
// return (await axios[method](`${service}${url}`, payload, {headers: {jwt: SERVICE_ACCESS_TOKEN, service: true}, timeout: 1000 })).data // Worked Earlier, but issue spotted
|
|
104
104
|
if (baseFeature) { // Local call
|
|
105
105
|
let response;
|
|
106
|
-
let req = { body: payload, params: params ?? {}, method, path: url, url: '', headers: {}, query: {}, on: (_event, _callback) => { } };
|
|
106
|
+
let req = { body: payload, params: params ?? {}, method, path: decodeURIComponent(url), url: '', headers: {}, query: {}, on: (_event, _callback) => { } };
|
|
107
107
|
req = JSON.parse(JSON.stringify(req));
|
|
108
108
|
const callback = (payload) => { response = payload; };
|
|
109
109
|
const res = {
|
package/libs/features.ts
CHANGED
|
@@ -203,7 +203,7 @@ export const send = async <K extends keyof FeatureTypes> (meta: Partial<FeatureM
|
|
|
203
203
|
|
|
204
204
|
if (params || url.includes(':')) {
|
|
205
205
|
for (let key in params)
|
|
206
|
-
url = url.replace(`:${key}`, params[key]!)
|
|
206
|
+
url = url.replace(`:${key}`, encodeURIComponent(params[key]!))
|
|
207
207
|
if (url.includes(':'))
|
|
208
208
|
throw new Error(`Error: Internal feature call send on feature: ${feature} when api/params/substitution`)
|
|
209
209
|
}
|
|
@@ -217,7 +217,7 @@ export const send = async <K extends keyof FeatureTypes> (meta: Partial<FeatureM
|
|
|
217
217
|
// return (await axios[method](`${service}${url}`, payload, {headers: {jwt: SERVICE_ACCESS_TOKEN, service: true}, timeout: 1000 })).data // Worked Earlier, but issue spotted
|
|
218
218
|
if (baseFeature) { // Local call
|
|
219
219
|
let response;
|
|
220
|
-
let req: ExpressRequest = { body: payload, params: params ?? {}, method, path: url, url: '', headers: {}, query: {}, on: (_event: string, _callback:()=>void) => {} }
|
|
220
|
+
let req: ExpressRequest = { body: payload, params: params ?? {}, method, path: decodeURIComponent(url), url: '', headers: {}, query: {}, on: (_event: string, _callback:()=>void) => {} }
|
|
221
221
|
req = JSON.parse(JSON.stringify(req))
|
|
222
222
|
const callback = (payload: unknown): void => { response = payload }
|
|
223
223
|
const res: ExpressResponse = {
|