Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
darekf77 committed Sep 23, 2023
1 parent cd0b7f6 commit 6ddab8e
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -469,4 +469,4 @@
"vpn-split": "~16.0.3",
"yup": "1.1.1"
}
}
}
2 changes: 2 additions & 0 deletions projects/container-v4/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@
"json5": "2.2.1",
"lodash": "4.17.20",
"moment": "2.29.3",
"pretty-error": "~4.0.0",
"copy-paste": "1.5.3"
},
"linkedFolders": [],
Expand Down Expand Up @@ -472,6 +473,7 @@
"pica": "9.0.1",
"portfinder": "1.0.21",
"prettier": "3.0.0",
"pretty-error": "4.0.0",
"progress": "2.0.3",
"prompts": "0.1.8",
"ps-list": "6.1.0",
Expand Down
2 changes: 2 additions & 0 deletions projects/container-v4/package.json_tnp.json5
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,8 @@
lodash: '4.17.20',
moment: '2.29.3',

"pretty-error": "~4.0.0",

// "minimist": "1.2.0",
// ------------------------------------------------------------------
// ------ CHECK/EXPLORE ---------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions src/lib/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//#region imports
import { _, crossPlatformPath } from 'tnp-core';
import { Helpers, _, crossPlatformPath } from 'tnp-core';
//#region @websql
import { path } from 'tnp-core';
//#endregion
Expand Down Expand Up @@ -171,8 +171,8 @@ export class MorphiHelpers extends HelpersNg2Rest {
const result = await asyncResponse(req, res);
resolve(result as any);
} catch (e) {
console.error(e);
console.error('[firedev] Bad async function call ')
Helpers.renderError(e);
reject(e);
}
} else if (typeof response === 'object') {
Expand All @@ -184,8 +184,8 @@ export class MorphiHelpers extends HelpersNg2Rest {
resolve(response.send as any)
}
} catch (error) {
console.error(error);
console.error('[firedev] Bad synchonus function call ')
Helpers.renderError(error);
reject(error);
}
} else reject(`[firedev] Not recognized type of reposne ${response}`);
Expand Down
2 changes: 2 additions & 0 deletions src/lib/init-method/init-method-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ export function initMethodNodejs(
let result = await MorphiHelpers.getResponseValue(response, req, res);

if (result instanceof Blob && (methodConfig.responseType as ModelsNg2Rest.ResponseTypeAxios) === 'blob') {
console.log('INSTANCE OF BLOB')
//#region processs blob result type
const blob = result as Blob;
const file = Buffer.from(await blob.arrayBuffer());
Expand All @@ -174,6 +175,7 @@ export function initMethodNodejs(
res.end(file);
//#endregion
} else if (_.isString(result) && (methodConfig.responseType as ModelsNg2Rest.ResponseTypeAxios) === 'blob') {
console.log('BASE64')
//#region process string buffer TODO refacetor
const img_base64 = result;
const m = /^data:(.+?);base64,(.+)$/.exec(img_base64)
Expand Down

0 comments on commit 6ddab8e

Please sign in to comment.