cardus 0.0.77 → 0.0.78

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 (3) hide show
  1. package/dist/index.js +10 -3
  2. package/index.ts +10 -4
  3. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -212,9 +212,16 @@ class IntegrationManager {
212
212
  [];
213
213
  if (integrationShipmentDetails) {
214
214
  const shipmentContentFromDetails = yield Promise.all(integrationShipmentDetails.map((detail) => __awaiter(this, void 0, void 0, function* () {
215
- const taric = detail.bulto.nombre_producto
216
- ? yield llmAPIService.getTaricCode('chatgpt', detail.bulto.nombre_producto)
217
- : null;
215
+ let taric = null;
216
+ try {
217
+ if (detail.bulto.nombre_producto) {
218
+ taric = yield llmAPIService.getTaricCode('chatgpt', detail.bulto.nombre_producto);
219
+ }
220
+ }
221
+ catch (e) {
222
+ if (e instanceof Error)
223
+ console.error(e.stack);
224
+ }
218
225
  return {
219
226
  id_envio: detail.id_envio,
220
227
  id_usuario: idUsuario,
package/index.ts CHANGED
@@ -298,12 +298,18 @@ export class IntegrationManager {
298
298
  if (integrationShipmentDetails) {
299
299
  const shipmentContentFromDetails = await Promise.all(
300
300
  integrationShipmentDetails.map(async (detail) => {
301
- const taric = detail.bulto.nombre_producto
302
- ? await llmAPIService.getTaricCode(
301
+ let taric = null;
302
+
303
+ try {
304
+ if (detail.bulto.nombre_producto) {
305
+ taric = await llmAPIService.getTaricCode(
303
306
  'chatgpt',
304
307
  detail.bulto.nombre_producto
305
- )
306
- : null;
308
+ );
309
+ }
310
+ } catch (e) {
311
+ if (e instanceof Error) console.error(e.stack);
312
+ }
307
313
 
308
314
  return {
309
315
  id_envio: detail.id_envio,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cardus",
3
- "version": "0.0.77",
3
+ "version": "0.0.78",
4
4
  "description": "an integration manager",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",