rez_core 3.1.104 → 3.1.105

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rez_core",
3
- "version": "3.1.104",
3
+ "version": "3.1.105",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -1,10 +1,7 @@
1
1
  import { Injectable, Logger } from '@nestjs/common';
2
- import axios, { AxiosResponse } from 'axios';
2
+ import axios from 'axios';
3
3
  import { randomUUID } from 'crypto';
4
- import {
5
- IntegrationResult,
6
- IntegrationStrategy,
7
- } from '../integration.strategy';
4
+ import { IntegrationResult, IntegrationStrategy } from '../integration.strategy';
8
5
 
9
6
  interface TubelightWhatsAppConfig {
10
7
  userName: string;
@@ -56,24 +53,24 @@ export class TubelightWhatsAppStrategy implements IntegrationStrategy {
56
53
 
57
54
  const payload = [this.prepareMessagePayload(to, message, config)];
58
55
 
59
- console.log(payload)
56
+ console.log(payload);
60
57
 
61
- const response: AxiosResponse<TubelightApiResponse> = await axios.post(
62
- url,
63
- JSON.stringify(payload),
64
- {
65
- headers: {
66
- 'Content-Type': 'application/json',
67
- Authorization: `Bearer ${token}`,
68
- },
69
- timeout: 30000,
58
+ const response = await fetch(url, {
59
+ method: 'POST',
60
+ headers: {
61
+ 'Content-Type': 'application/json',
62
+ Authorization: `Bearer ${token}`,
70
63
  },
71
- );
64
+ body: JSON.stringify(payload),
65
+ signal: AbortSignal.timeout(30000),
66
+ });
67
+
68
+ const data = await response.json();
72
69
 
73
70
  if (
74
71
  response.status === 200
75
72
  ) {
76
- const messageId = response.data.messageId || response.data.id;
73
+ const messageId = data.messageId || data.id;
77
74
  this.logger.log(
78
75
  `Tubelight WhatsApp message sent successfully to ${to}, messageId: ${messageId}`,
79
76
  );
@@ -87,8 +84,8 @@ export class TubelightWhatsAppStrategy implements IntegrationStrategy {
87
84
  };
88
85
  } else {
89
86
  throw new Error(
90
- response.data?.error ||
91
- response.data?.message ||
87
+ data?.error ||
88
+ data?.message ||
92
89
  'Invalid response from Tubelight API',
93
90
  );
94
91
  }
@@ -174,7 +171,7 @@ export class TubelightWhatsAppStrategy implements IntegrationStrategy {
174
171
 
175
172
  // Add body_params if provided
176
173
  if (config.variables) {
177
- console.log("variables", config.variables)
174
+ console.log('variables', config.variables);
178
175
  try {
179
176
  // Parse JSON string
180
177
  const parsedVariables = typeof config.variables === 'string'
@@ -1,5 +0,0 @@
1
- {
2
- "recommendations": [
3
- "dbaeumer.vscode-eslint"
4
- ]
5
- }