pangea-server 3.3.143 → 3.3.144

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.
@@ -13,3 +13,4 @@ export * from './multer.helpers';
13
13
  export * from './pass.helpers';
14
14
  export * from './print.helpers';
15
15
  export * from './random.helpers';
16
+ export * from './whatsapp.helpers';
@@ -29,3 +29,4 @@ __exportStar(require("./multer.helpers"), exports);
29
29
  __exportStar(require("./pass.helpers"), exports);
30
30
  __exportStar(require("./print.helpers"), exports);
31
31
  __exportStar(require("./random.helpers"), exports);
32
+ __exportStar(require("./whatsapp.helpers"), exports);
@@ -0,0 +1,9 @@
1
+ export declare class Whatsapp {
2
+ private __accessToken;
3
+ private __phoneNumberId;
4
+ constructor(config: {
5
+ accessToken: string;
6
+ phoneNumberId: string;
7
+ });
8
+ sendText(to: string, text: string): Promise<import("@whatsapp-cloudapi/types/cloudapi", { with: { "resolution-mode": "import" } }).CloudAPIResponse>;
9
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.Whatsapp = void 0;
7
+ const client_1 = __importDefault(require("@whatsapp-cloudapi/client"));
8
+ class Whatsapp {
9
+ constructor(config) {
10
+ this.__accessToken = config.accessToken;
11
+ this.__phoneNumberId = config.phoneNumberId;
12
+ }
13
+ async sendText(to, text) {
14
+ return client_1.default.sendTextMessage({ accessToken: this.__accessToken, from: this.__phoneNumberId, to, text });
15
+ }
16
+ }
17
+ exports.Whatsapp = Whatsapp;
@@ -14,7 +14,6 @@ const validate_request_1 = require("../validator/validate-request");
14
14
  function callController(controller, validate, appVersion, authConfig) {
15
15
  const { authMap, authCtor, initAuthCtor, accessToken } = authConfig;
16
16
  return async function (req, res) {
17
- const reqId = (0, helpers_1.getRandomString)(6);
18
17
  const headers = req.headers;
19
18
  if ((0, helpers_1.getEnvStr)('ENVIRONMENT') !== 'development' && appVersion !== headers['x-app-version']) {
20
19
  helpers_1.AppError.Throw({ statusCodeName: 'BAD_REQUEST', errorCode: 'APP_VERSION_MISMATCH' });
package/package.json CHANGED
@@ -1,7 +1,10 @@
1
1
  {
2
2
  "name": "pangea-server",
3
3
  "description": "",
4
- "version": "3.3.143",
4
+ "version": "3.3.144",
5
+ "engines": {
6
+ "node": "22.14.0"
7
+ },
5
8
  "files": [
6
9
  "dist"
7
10
  ],
@@ -34,6 +37,7 @@
34
37
  "dependencies": {
35
38
  "@afipsdk/afip.js": "1.2.3",
36
39
  "@google/genai": "1.34.0",
40
+ "@whatsapp-cloudapi/client": "4.2.0",
37
41
  "aws-sdk": "2.1692.0",
38
42
  "bcrypt": "5.1.1",
39
43
  "compression": "1.7.5",